Time of Update: 2018-12-03
seven讓我把C++ primer第四版演算法這張好好看看,我看完後就摘抄了這麼點而已1、findvector<int>::const_iterator result=find(vec.begin(),vec.end(),search_value);int a[6];int *result=find(a,a+6,search_value);2、accumulateint
Time of Update: 2018-12-03
今天學會了如何用C++進行二進位隱藏檔,和seven在QQ上討論了很久,一直沒有做出來,後來發現是一個函數的問題。估計很多人都知道用ofstream out("test.binary",ios::binary|ios::out);和這個ifstream in("test.binary",ios::binary|ios::in);這兩個是設定檔案的讀取和寫入的方式,這裡是按照二進位,不過有一點很重要,就是不能直接用out << 和 in>>,需要用read
Time of Update: 2018-12-03
using System;public class test{ static string Add(string x, string y) { string s3 = ""; int l1 = x.Length; int l2 = y.Length; Console.WriteLine("s1.length : {0} s2.length : {1} ", l1, l2); while (l1 > 0 ||
Time of Update: 2018-12-03
#include <iostream>#include <conio.h>#include <windows.h>#include <string.h>#include <winuser.h>#include <wincon.h>HANDLE hOut ;HANDLE hIn ;void DeleteLine(int row); // 刪除一行void MoveText(int x, int y, SMALL_RECT
Time of Update: 2018-12-03
今天遇到一個問題,需要客戶在點擊一個按鈕後,能夠提示是否確定,如果確定,則要求使用者輸入一個數字,並講這個數字寫入資料庫。剛開始覺得很簡單,後來遇到很多問題,也搜了很多JS和後台互動的東西,最後做出來了,看來有些東西還是需要動手才能有效果。 好吧說思路。前台JS有個一confirms()函數,用於實現提醒使用者,和擷取使用者輸入值。這個值儲存在<input id="username" runat ="server" name="username" value="10" />&
Time of Update: 2018-12-03
很多人對學習C語言感到無從下手,經常問我同一個問題:究竟怎樣學習C語言?我是一個教師,已經開發了很多年的程式,和很多剛剛起步的人一樣,學習的第一個電腦語言就是C語言。經過這些年的開發,我深深的體會到C
Time of Update: 2018-12-03
time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe little girl loves the problems on array queries very much.One day she came across a rather well-known problem: you've got an array
Time of Update: 2018-12-03
JS實現頁面跳轉第一種: <script language="javascript" type="text/javascript"> window.location.href="login.jsp?backurl="+window.location.href; </script>第二種: <script language="javascript">alert("返回");window.history.back(-1);
Time of Update: 2018-12-03
在Java中有一個Super關鍵字,可以調用父類的構造方法和非私人成員。C#中使用的關鍵字是base,但用法不完全相同。1. 調用父類的構造方法// 父類 public class Father { public Father(String name) { this.name = name; } private String name; } // 子類 public class Son:Father { public Son(String
Time of Update: 2018-12-03
從網上找到一套Linux
Time of Update: 2018-12-03
再熟悉不過的資料結構了,也是普遍的一個基礎貼代碼~~~#define MAXSIZE 10typedef struct{ int data[MAXSIZE]; int top;}SqStack;SqStack sqt;int total=4;void InitStack(SqStack &st){ st.top=-1;}int StackEmpty(SqStack st){ return (st.top==-1);}int push(SqStack
Time of Update: 2018-12-03
(1)MessageBox(NULL,TEXT("世界你好"),TEXT("問好"),MB_OK); 第一個參數暫時不講;第二個是本文;第三個是標題(Caption);第四個是類型。MB_OK就是表示有一個OK按鈕【確定】)TEXT是一個宏,當字串中有中文的時候最好用TEXT來包圍這個字串,雖然不使用TEXT在VC6中沒問題,但是在VC7中有問題,而且微軟也建議使用TEXT宏,因此在涉及到中文的場合要使用它。他的作用就是把中文轉化成不會亂碼的格式。(暫時這麼認為)。_T("問好"
Time of Update: 2018-12-03
comes from: http://watershitter.iteye.com/blog/4776151 java 中 c語言函數的聲明 public native static void greeting(); //就像是介面聲明一樣,不過有native! 2 編譯 javac HelloNative.java ,然後使用 javah javah HelloNative會自動產生c的標頭檔HelloNative.h3 產生的標頭檔 的 第一句子為 #include
Time of Update: 2018-12-03
上午寫的時候條件弄錯了,一直無解……改過條件後不知道這樣寫對不對,期待指正。/*題目描述:a: b,c 說的是真話b: a,c 說的是假話c: a,b 至少有一個說的是假話此題只要找出誰是說真話的即可。分別假設各個說真話的人,窮舉找到答案。*/#include<iostream>#include<algorithm>#include<iterator>using namespace std;bool a,b,c;bool aistrue(){return a&
Time of Update: 2018-12-03
本文僅為存檔。#include<iostream>using namespace std;int c=0;class C{public :int a;int b;C(){a=c++;};void fun(){cout<<1<<endl;}};class CC:public C{int a;void fun(){cout<<2<<endl;}void f(){cout<<3<<endl;}};class
Time of Update: 2018-12-03
它們是被神所遺棄的孩子,沒有人見過它們,更沒有人知道它們的名字.它們命中註定徘徊於命運邊緣高聳的懸崖和幽深的深淵之間, 用自己短暫的生命撫平了生與死之間的縫隙.譬如朝露,卻與陽光無緣.是該為它們立一座豐碑的時候了,墓銘志上寫著:我來了,我走了,我快樂過. 許多人對臨時變數的理解僅僅限於: string
Time of Update: 2018-12-03
原文:http://www.jdzj.com/datum/showart.asp?art_id=12733前幾天搞定了C++的多線程編程,今天閑來無事小做總結!【線程的概念】為了瞭解線程的概念,我們必須先討論一下進程的概念。 一個進程通常定義為程式的一個執行個體。在Win32中, 進程佔據4GB的地址空間。與它們在MS-DOS和16位Windows作業系統中不同,
Time of Update: 2018-12-03
轉載請註明出處,謝謝http://blog.csdn.net/ACM_cxlove?viewmode=contents by---cxlove題意:有n個盒子,每個盒子有若干個氣球,每次操作可以拿走某個盒子的一個氣球,然後
Time of Update: 2018-12-03
轉載請註明出處,謝謝http://blog.csdn.net/ACM_cxlove?viewmode=contents
Time of Update: 2018-12-03
轉載請註明出處,謝謝http://blog.csdn.net/ACM_cxlove?viewmode=contents by---cxlove題目:給出n個數,選出三個數,按下標順序形成等差數列http://www.codechef.com/problems/COUNTARI如果只是形成 等差數列並不難,大概就是先求一次卷積,然後再O(n)枚舉,判斷2 * a[i]的種數,不過按照下標就不會了。有種很矬的,大概就是O(n)枚舉中間的數,然後 對兩邊分別卷積,O(n * n *