锘??xml version="1.0" encoding="utf-8" standalone="yes"?>日韩手机在线导航,久久久久欧美,欧美中文字幕久久 http://www.shnenglu.com/liyuxia713/韞掕窔鍓嶈鑰?/description>zh-cn Sat, 29 Nov 2025 04:04:47 GMT Sat, 29 Nov 2025 04:04:47 GMT 60 鍐呭瓨綆$悊 http://www.shnenglu.com/liyuxia713/archive/2010/06/05/117211.html騫歌繍鑽?/dc:creator>騫歌繍鑽?/author>Sat, 05 Jun 2010 01:34:00 GMT http://www.shnenglu.com/liyuxia713/archive/2010/06/05/117211.html http://www.shnenglu.com/liyuxia713/comments/117211.html http://www.shnenglu.com/liyuxia713/archive/2010/06/05/117211.html#Feedback 3 http://www.shnenglu.com/liyuxia713/comments/commentRss/117211.html http://www.shnenglu.com/liyuxia713/services/trackbacks/117211.html 鎵╁睍闃呰
鍐呭瓨鐨勪笁縐嶅垎閰嶆柟寮忥細(xì)
1錛?nbsp;浠庨潤鎬佸瓨鍌ㄥ尯鍒嗛厤錛氭鏃剁殑鍐呭瓨鍦ㄧ▼搴忕紪璇戠殑鏃跺欏凡緇忓垎閰嶅ソ錛屽茍涓斿湪紼嬪簭鐨勬暣涓繍琛屾湡闂撮兘瀛樺湪銆傚叏灞鍙橀噺錛宻tatic鍙橀噺絳夊湪姝ゅ瓨鍌ㄣ?/p>
2錛?nbsp;鍦ㄦ爤鍖哄垎閰嶏細(xì)鐩稿叧浠g爜鎵ц鏃跺垱寤猴紝鎵ц緇撴潫鏃惰鑷姩閲婃斁銆傚眬閮ㄥ彉閲忓湪姝ゅ瓨鍌ㄣ傛爤鍐呭瓨鍒嗛厤榪愮畻鍐呯疆浜庡鐞嗗櫒鐨勬寚浠ら泦涓紝鏁堢巼楂橈紝浣嗗閲忔湁闄愩?/p>
3錛?nbsp;鍦ㄥ爢鍖哄垎閰嶏細(xì)鍔ㄦ佸垎閰嶅唴瀛樸傜敤new/malloc鏃跺紑杈燂紝delete/free鏃墮噴鏀俱傜敓瀛樻湡鐢辯敤鎴鋒寚瀹氾紝鐏墊椿銆備絾鏈夊唴瀛樻硠闇茬瓑闂銆?/p>
甯歌鍐呭瓨閿欒鍙婂絳?/p>
1錛?nbsp;鍐呭瓨鍒嗛厤鏈垚鍔燂紝鍗磋浣跨敤銆?/p>
瀵圭瓥錛氫嬌鐢ㄥ唴瀛樹箣鍓嶆鏌ユ槸鍚﹀垎閰嶆垚鍔熴傜敤p!=NULL鍒ゆ柇銆?/p>
2錛?nbsp;鍐呭瓨鍒嗛厤鎴愬姛錛屾湭鍒濆鍖栧氨琚嬌鐢ㄣ?/p>
鍐呭瓨鐨勭己鐪佸兼病鏈夌粺涓鐨勬爣鍑嗐傚ぇ閮ㄥ垎緙栬瘧鍣ㄤ互0浣滀負(fù)鍒濆鍊鹼紝浣嗕笉瀹屽叏鏄?/p>
瀵圭瓥錛氬唴瀛樺垵濮嬪寲鏃惰祴鍒濆箋?/p>
3錛?nbsp;鍐呭瓨鎿嶄綔瓚婄晫銆?/p>
瀵圭瓥錛氬彧鑳芥槸灝忓績浜嗐?/p>
4錛?nbsp;閲婃斁浜嗗唴瀛橈紝浠嶇劧浣跨敤銆?/p>
錛?錛?nbsp; 浣跨敤鏄劇ずdelete鍜宖ree鐨勯噹鎸囬拡銆?/p>
瀵圭瓥錛氶噴鏀懼畬鍐呭瓨錛屽皢鎸囬拡緗負(fù)NULL銆?/p>
錛?錛?nbsp; 浣跨敤闅愬紡delete鍜宖ree鐨勯噹鎸囬拡銆備富瑕佹槸鎸囧嚱鏁拌繑鍥炴寚鍚戞爤鍐呭瓨鐨勬寚閽堟垨寮曠敤銆?/p>
瀵圭瓥錛氬綋鐒舵槸涓嶈榪斿洖灝卞彲浠ヤ簡銆?/p>
5錛?nbsp;鏈噴鏀懼唴瀛橈紝瀵艱嚧鍐呭瓨娉勯湶銆?/p>
鐢╪ew/malloc寮杈熶簡鍐呭瓨錛屾病鐢╠elete/free閲婃斁.
瀵圭瓥錛歯ew鍜宒elete鐨勪釜鏁頒竴瀹氱浉鍚岋紱malloc鍜宖ree鐨勪釜鏁頒竴瀹氱浉鍚岋紱new[]鍜孾]delete涓瀹氬搴斻?br> 紺轟緥1錛氳繑鍥炴寚鍚戞爤絀洪棿鐨勬寚閽?br>
1 char * test1() 2 { 3 char str[] = " Hello World! " ; 4 return str; 5 } 6 7 char * test2() 8 { 9 char * str = " Hello World! " ; 10 return str; 11 }12 13 char * test3() 14 { 15 static char str[] = " Hello World! " ; 16 return str; 17 }18 19 void main() 20 { 21 char * str = NULL; 22 23 str = test1(); 24 cout << str << endl; // 鍨冨溇淇℃伅 25 26 str = test2(); 27 cout << str << endl; // ok 28 // str[1] = 'A' ; // error.璇曞浘淇敼甯稿瓧絎︿覆 29 // str = NULL; // error.璇曞浘淇敼甯稿瓧絎︿覆 30 31 str = test3(); 32 cout << str << endl; 33 }34
杈撳嚭緇撴灉錛?br>涔辯爜
Hello World!
Hello World!紺轟緥2錛?/span>new 鍜?/span>delete 铏界劧瀵瑰簲錛屼絾 delete 閲婃斁涓嶆垚鍔?/span>
void main() { char * p = new char [ 4 ]; p = " ppp " ; delete []p; }
榪愯鏃墮敊璇?/span>P 铏界劧鏄姩鎬佸紑杈熺殑鍐呭瓨錛屼絾鍦ㄧ浜屾潯璇彞鍚?/span>p 宸茬粡鎸囧悜浜嗛潤鎬佸瓨鍌ㄥ尯涓婄殑鍦板潃錛岃屽鎸囧悜闈欐佸瓨鍌ㄥ尯鐨勬寚閽堟槸涓嶈兘鐢?/span>delete 閲婃斁鐨勩傛鏃朵笉浠呰繍琛屾椂閿欒錛岃繕鏈夊唴瀛樻硠闇層?/span>
]]>sscanf http://www.shnenglu.com/liyuxia713/archive/2010/04/25/113530.html騫歌繍鑽?/dc:creator>騫歌繍鑽?/author>Sun, 25 Apr 2010 12:13:00 GMT http://www.shnenglu.com/liyuxia713/archive/2010/04/25/113530.html http://www.shnenglu.com/liyuxia713/comments/113530.html http://www.shnenglu.com/liyuxia713/archive/2010/04/25/113530.html#Feedback 0 http://www.shnenglu.com/liyuxia713/comments/commentRss/113530.html http://www.shnenglu.com/liyuxia713/services/trackbacks/113530.html int sscanf(const char* str, const char* format, ...)functions: Reads data from str and stores them according to the parameter format into the locations given by the additional arguments. Locations pointed by each additional argument are filled with their corresponding type of value specified in the format string. In the format:Whitespace character: the function will read and ignore any whitespace characters which are encounterd before the next non-whitespace character. Non-whitespace character: except percentage signs(%): any character that is not either a whitespace character or part of a format specifier causes the function to read the next character from str, compare it to this non-whitespace character and if it matches, it is discarded and the function continues with the next character of format and str. If the character does not match, the function fails and returns.Return Value: On success. the function returns the number of items successfully read. On failure: In the case of an input failure before any data could be successfully read, EOF is returnded.
// 榛樿浠ョ┖鏍煎垎闅攕tr涓轟笉鍚屽瓧絎︿覆,榪斿洖姝g‘杈撳叆鐨勫彉閲忎釜鏁?nbsp; char buf1[ 512 ] = { 0 } ; cout << sscanf( " abc def gh " , " %s " ,buf1) << endl; // 1 cout << buf1 << endl; // abc // 鍙互浣垮涓竴璧峰瓨鍏?nbsp; char buf2[ 512 ] = { 0 } ; char buf3[ 512 ] = { 0 } ; cout << sscanf( " abc 2def gh " , " %s%s " ,buf2,buf3) << endl; // 2 cout << buf2 << endl; // abc cout << buf3 << endl; // 2def // 絀烘牸鎴杅ormat鏍煎紡浠ュ鐨勫瓧絎﹀鏋滃尮閰嶅垯涓庡墠涓涓瓧絎︿覆涓璧瘋緭鍏ワ紝鍚﹀垯鍋滄錛岄鍑?nbsp; char buf4[ 512 ] = { 0 } ; char buf5[ 512 ] = { 0 } ; cout << sscanf( " abc 2def gh " , " %s,%s " ,buf4,buf5) << endl; // 1 cout << buf4 << endl; // abc cout << buf5 << endl; // nothing char buf6[ 512 ] = { 0 } ; char buf7[ 512 ] = { 0 } ; // 娉ㄦ剰涓や釜%s涔嬮棿鐨勭┖鏍間笉鍙皯 sscanf( " abc 2def gh " , " %s 2%s " ,buf6,buf7); cout << buf6 << endl; // abc cout << buf7 << endl; // def // 褰撶劧涓嶅彧鏄瓧絎︿覆褰㈠紡鐨勶紝鍏朵粬涔熼兘鍙互 char buf8[ 512 ] = { 0 } ; int a; cout << sscanf( " abc 2def gh " , " %*s %d " , & a) << endl; // 1 cout << a << endl; // 2 // Failure int b; cout << sscanf( " abc " , " %d " , & b) << endl; // 0
]]> sprintf http://www.shnenglu.com/liyuxia713/archive/2010/04/25/113525.html騫歌繍鑽?/dc:creator>騫歌繍鑽?/author>Sun, 25 Apr 2010 11:23:00 GMT http://www.shnenglu.com/liyuxia713/archive/2010/04/25/113525.html http://www.shnenglu.com/liyuxia713/comments/113525.html http://www.shnenglu.com/liyuxia713/archive/2010/04/25/113525.html#Feedback 0 http://www.shnenglu.com/liyuxia713/comments/commentRss/113525.html http://www.shnenglu.com/liyuxia713/services/trackbacks/113525.html http://www.cplusplus.com/reference/clibrary/cstdio/sprintf/
Portotype: int printf(char* str, const char* format, parameters);
Writes into the array pointed by str a C string consisting on a sequence of data formatted as the format argument specifies. After the format parameter, the function expects at least as many additional arguments as specified in format .
This function behaves exactly as printf does, but writing its result to a string instead of stdout . The size of the array passed as str should be enough to contain the entire formatted string .
Return value:
On success, the total number of characters written is returned. This count does not include the additional null-character automatically appended at the end of the string.
// Success // The size of str is long enough // the number of additional number match with the format const int size = 25 ; char * str = new char [size]; //same as int flag1 = sprintf(str,"%s is written to str.","Test","tEST"); int flag1 = sprintf(str, " %s is written to str. " , " Test " ); // Console: 23-Test is written to str cout << flag1 << " - " << str << endl;
On failure, a negative number is returned.
// Failure1 // additional arguments numbers is less than specified is format // the second %s transmited as unrecognizable words const int size = 25 ; char * str = new char [size]; int flag2 = sprintf(str, " %s %s tttttttttttt " , " Test " ); // Console: 19--Test @ tttttttttttt cout << flag2 << " -- " << str << endl;
// Failure2:the size of str is not long enough // 鍦╠ev c++涓嶈兘榪愯錛寁c6.0娌掓湁闂 const int size = 25 ; char * str = new char [size]; int flag3 = sprintf(str, " %s jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj " , " Test " ); // VC6.0 Console: Test jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj // Dev c++: Console: the same as vc6.0 but throws an cannot read memory exception cout << flag3 << " -- " << str << endl;
娌℃湁嫻嬭瘯鍑轟粈涔堟椂鍊欏嚭閿欒繑鍥炶礋鍊煎憿錛侊紒璋佺粰鎴戜竴涓緥瀛愶紵
]]> 鎸囬拡瀛︿範(fàn)4--鍚堟垚鏋愭瀯鍑芥暟鍋氫簡浠涔?/title> http://www.shnenglu.com/liyuxia713/archive/2010/04/19/112952.html騫歌繍鑽?/dc:creator>騫歌繍鑽?/author>Mon, 19 Apr 2010 00:49:00 GMT http://www.shnenglu.com/liyuxia713/archive/2010/04/19/112952.html http://www.shnenglu.com/liyuxia713/comments/112952.html http://www.shnenglu.com/liyuxia713/archive/2010/04/19/112952.html#Feedback 0 http://www.shnenglu.com/liyuxia713/comments/commentRss/112952.html http://www.shnenglu.com/liyuxia713/services/trackbacks/112952.html 涓庡鍒舵瀯閫犲嚱鏁板拰澶嶅埗鎿嶄綔絎︿笉鍚岋紝緙栬瘧鍣ㄦ繪槸鎻愪緵鍚堟垚鏋愭瀯鍑芥暟銆?br> 鍚堟垚鏋愭瀯鍑芥暟鍋氫粈涔堬紵 鎸夊璞″垱寤烘椂鐨勯嗗簭鎾ら攢姣忎釜闈瀞tatic鎴愬憳錛屽寘鎷寚閽堟垚鍛樸?br>鍙笉榪囦笉鍒犻櫎鎸囬拡鎴愬憳鎵鎸囧悜鐨勫璞°?/span>
]]> 鎸囬拡瀛︿範(fàn)3----浣曟椂闇瑕佽嚜琛屽畾涔夋瀽鏋勫嚱鏁?/title> http://www.shnenglu.com/liyuxia713/archive/2010/04/18/112928.html騫歌繍鑽?/dc:creator>騫歌繍鑽?/author>Sun, 18 Apr 2010 11:59:00 GMT http://www.shnenglu.com/liyuxia713/archive/2010/04/18/112928.html http://www.shnenglu.com/liyuxia713/comments/112928.html http://www.shnenglu.com/liyuxia713/archive/2010/04/18/112928.html#Feedback 0 http://www.shnenglu.com/liyuxia713/comments/commentRss/112928.html http://www.shnenglu.com/liyuxia713/services/trackbacks/112928.html 褰撳湪綾葷殑鏋勯犲嚱鏁頒綋涓敵璇蜂簡璧勬簮(濡傚唴瀛樼┖闂?錛岄渶瑕佸湪瀵硅薄琚攢姣佹椂榪涜閲婃斁鏃躲?
class Test { public : Test( const char * ptr) { if (ptr) { p = new char [strlen(ptr)]; } } ~ Test() { delete[] p; } private : char * p; } ;
]]> 鎸囬拡瀛︿範(fàn)2--鍐呭瓨娉勯湶 http://www.shnenglu.com/liyuxia713/archive/2010/04/18/112897.html騫歌繍鑽?/dc:creator>騫歌繍鑽?/author>Sun, 18 Apr 2010 04:06:00 GMT http://www.shnenglu.com/liyuxia713/archive/2010/04/18/112897.html http://www.shnenglu.com/liyuxia713/comments/112897.html http://www.shnenglu.com/liyuxia713/archive/2010/04/18/112897.html#Feedback 0 http://www.shnenglu.com/liyuxia713/comments/commentRss/112897.html http://www.shnenglu.com/liyuxia713/services/trackbacks/112897.html 錛?
1 #include < iostream > 2 using namespace std; 3 4 class Stu 5 { 6 public : 7 Stu(int m):var(m) 8 { 9 cout << var << " constructor called. " << endl; 10 } 11 ~ Stu() { cout << var << " destructor called. " << endl;} 12 private : 13 int var; 14 }; 15 16 17 int main() 18 { 19 Stu * a = new Stu( 20 ); 20 Stu * b = new Stu( 30 ); 21 delete b;22 return 0 ; 23 // or 鍏朵粬闅愯棌寮傚父 24 25 // 瀵艱嚧鍐呭瓨娉勯湶 26 delete a; 27 28 return 0 ; 29 }
]]> 鎸囬拡瀛︿範(fàn)1--new &delete & destructor http://www.shnenglu.com/liyuxia713/archive/2010/04/18/112892.html騫歌繍鑽?/dc:creator>騫歌繍鑽?/author>Sun, 18 Apr 2010 02:58:00 GMT http://www.shnenglu.com/liyuxia713/archive/2010/04/18/112892.html http://www.shnenglu.com/liyuxia713/comments/112892.html http://www.shnenglu.com/liyuxia713/archive/2010/04/18/112892.html#Feedback 0 http://www.shnenglu.com/liyuxia713/comments/commentRss/112892.html http://www.shnenglu.com/liyuxia713/services/trackbacks/112892.html 1. 涓鑸寚閽堢殑new&delete
瀵逛簬鎸囬拡 a,delete a 涔嬪悗錛屾寚閽?/span>a 鐨勫湴鍧浠嶇劧鏄師鏉ョ殑鍦板潃(騫朵笉鏄疦ULL)錛屽彧涓嶈繃鎵鎸囧悜鐨勫璞¤閲婃斁浜嗭紝姝ゆ椂鎸囬拡瀛樻斁鐨勫間負(fù)闅忔満鐨勶紝鐢辯紪璇戝櫒紜畾銆?br>
1 int * a = new int ( 2 ); 2 cout << " after new : " << endl; 3 cout << " a = " << a << " , " << " *a = " << * a << endl; 4 5 delete a; 6 cout << " after delete: " << endl; 7 if (a == NULL) 8 { 9 cout << " a is null after delete " << endl; 10 }11 else 12 { 13 cout << " a is not null after delete " << endl; 14 }15 cout << " a = " << a << " , " << " *a = " << * a << endl;
// 濂界殑緙栫▼涔?fàn)鎯?/span>delete a; a = NULL;
甯歌鏂規(guī)硶鍒涘緩鐨勫璞★紝褰撳疄闄呭璞★紙鑰屼笉鏄璞$殑寮曠敤錛夎秴鍑轟綔鐢ㄥ煙鏃訛紝鎵嶄細(xì)榪愯鏋愭瀯鍑芥暟 鍔ㄦ佹柟娉曞垱寤虹殑瀵硅薄錛屽綋鍒犻櫎鎸囧悜鍔ㄦ佸垎閰嶅璞$殑鎸囬拡鏃訛紝鎵嶄細(xì)榪愯鏋愭瀯鍑芥暟銆?nbsp; 2. 涓鑸被瀵硅薄鐨勫0鏄庝笌鍒濆鍖栵細(xì)涓嶇敤new涔熷彲浠ュ畾涔夌被瀵硅薄錛堝尯鍒簬java錛夛紝榛樿璋冩瀽鏋勫嚱鏁?br> 娉細(xì)涓烘柟渚跨畝鍗曟紨紺猴紝騫舵病鏈夐伒寰笁娉曞垯
1 class Stu 2 { 3 public : 4 Stu(int m):var(m) 5 { 6 var = m; 7 cout << " constructor called. " << endl; 8 } 9 ~ Stu() { cout << var << " destructor called. " << endl;} 10 private : 11 int var; 12 }; 13 14 void func() 15 { 16 // 璋冪敤鏋勯犲嚱鏁?/span>17 Stu a( 20 ); 18 // 璋冪敤榛樿澶嶅埗鏋勯犲嚱鏁?/span>19 Stu b(a); 20 // 絳変環(huán)浜嶴tu temp(b); Stu b(temp); 21 // 鎵浠ユ湁璋冪敤鏋勯犲嚱鏁扮殑榪囩▼ 22 Stu c = 30 ; 23 //閮芥槸鐢ㄩ殣寮忔柟寮忓畾涔夌殑錛屾墍浠ヤ笉鐢╠elete,鑷姩璋冪敤鏋愭瀯鍑芥暟 24 | //娉ㄦ剰鏋愭瀯鐨勯『搴?nbsp; 25 } 26 27 int main() 28 { 29 func(); 30 return 0 ; 31 }
榪欓噷鏈変竴涓渶瑕佹敞鎰忕殑鍦版柟錛屽氨鏄鏋渇unc閲岄潰鐨勪唬鐮佹槸鐩存帴鍐欏湪main閲岀殑鍒欎笉涓瀹氳皟鐢ㄦ瀽鏋勫嚱鏁?nbsp;錛岀敱緙栬瘧鍣ㄥ喅瀹氥?br>涓婇潰鏄痙ev c++, 涓嬮潰鏄痸c6.0鐨勮繍琛岀粨鏋?br>
1 2 int main() 3 { 4 5 // { 6 // 璋冪敤鏋勯犲嚱鏁?/span> 7 Stu a( 20 ); 8 // 璋冪敤榛樿澶嶅埗鏋勯犲嚱鏁?/span> 9 Stu b(a); 10 // 絳変環(huán)浜嶴tu temp(b); Stu b(temp); 11 // 鎵浠ユ湁璋冪敤鏋勯犲嚱鏁扮殑榪囩▼ 12 Stu c = 30 ; 13 // new鍑烘潵鐨勬寚閽堝璞★紝蹇呴』鏄劇ずdelete,濡俛,b 14 // 綾誨璞$粨鏉熷眬閮ㄨ寖鍥村悗浼?xì)鑷姩璋冪敤鏋愭瀯鍑芥?nbsp;濡俢 15 // } 16 return 0 ; 17 }
3. 鐢╪ew瀹氫箟綾誨璞?蹇呴』delete 鍔ㄦ佸垎閰嶇殑瀵硅薄鍙湁鍦ㄦ寚鍚戣瀵硅薄鐨勬寚閽堣鍒犻櫎鏃舵墠鎾ら攢銆傚鏋滄病鏈夊垹闄ゆ寚鍚戝姩鎬佸璞$殑鎸囬拡錛屽垯涓嶄細(xì)榪愯璇ュ璞$殑鏋愭瀯鍑芥暟錛屽璞″垯涓鐩村瓨鍦紝浠庤屽鑷村唴瀛樻硠闇層?br>甯歌鏂規(guī)硶鍒涘緩鐨勫璞★紝褰撳疄闄呭璞★紙鑰屼笉鏄璞$殑寮曠敤錛夎秴鍑轟綔鐢ㄥ煙鏃訛紝鎵嶄細(xì)榪愯鏋愭瀯鍑芥暟 鍔ㄦ佹柟娉曞垱寤虹殑瀵硅薄錛屽綋鍒犻櫎鎸囧悜鍔ㄦ佸垎閰嶅璞$殑鎸囬拡鏃訛紝鎵嶄細(xì)榪愯鏋愭瀯鍑芥暟銆?br>
1 class Stu 2 { 3 public : 4 Stu(int m):var(m) 5 { 6 var = m; 7 cout << " constructor called. " << endl; 8 } 9 ~ Stu() { cout << var << " destructor called. " << endl;} 10 private : 11 int var; 12 }; 13 14 void func() 15 { 16 // 璋冪敤鏋勯犲嚱鏁?/span>17 Stu * a = new Stu( 20 ); 18 // 璋冪敤榛樿澶嶅埗鏋勯犲嚱鏁?/span>19 Stu * b = new Stu( * a); 20 // 絳変環(huán)浜嶴tu temp = new Stu(30); Stu b(temp); 21 // 鎵浠ユ湁璋冪敤鏋勯犲嚱鏁扮殑榪囩▼ 22 Stu c = 30 ; 23 // new鍑烘潵鐨勬寚閽堝璞★紝蹇呴』鏄劇ずdelete,濡俛,b 24 // 綾誨璞$粨鏉熷眬閮ㄨ寖鍥村悗浼?xì)鑷姩璋冪敤鏋愭瀯鍑芥?nbsp;濡俢 25 delete a; 26 delete b;27 } 28 29 int main() 30 { 31 func(); 32 return 0 ; 33 }
]]> 瀹忎笌鍐呰仈(inline)鐨勫尯鍒?杞澆) http://www.shnenglu.com/liyuxia713/archive/2010/03/04/108897.html騫歌繍鑽?/dc:creator>騫歌繍鑽?/author>Thu, 04 Mar 2010 12:22:00 GMT http://www.shnenglu.com/liyuxia713/archive/2010/03/04/108897.html http://www.shnenglu.com/liyuxia713/comments/108897.html http://www.shnenglu.com/liyuxia713/archive/2010/03/04/108897.html#Feedback 0 http://www.shnenglu.com/liyuxia713/comments/commentRss/108897.html http://www.shnenglu.com/liyuxia713/services/trackbacks/108897.html 鍏堣漿杞戒笅浜哄鎬葷粨鐨勫畯鍜屾櫘閫氬嚱鏁拌皟鐢ㄧ殑鍖哄埆錛?br>(1)銆佸畯鍙仛綆鍗曠殑瀛楃涓叉浛鎹紝鍑芥暟鏄弬鏁頒紶閫掞紝鎵浠ュ繀鐒舵湁鍙傛暟綾誨瀷媯鏌?鏀寔鍚勭綾誨瀷錛岃屼笉鏄彧鏈夊瓧絎︿覆)銆?br>(2)銆佸畯涓嶇粡璁$畻鑰岀洿鎺ユ浛鎹㈠弬鏁幫紝鍑芥暟璋冪敤鍒欐槸灝嗗弬鏁拌〃杈懼紡姹傚煎啀浼犻掔粰褰㈠弬銆?br>(3)銆佸畯鍦ㄧ紪璇戝墠榪涜錛屽嵆鍏堟浛鎹㈠啀緙栬瘧銆傝屽嚱鏁版槸緙栬瘧鍚庯紝鍦ㄦ墽琛屾椂鎵嶈皟鐢ㄧ殑銆傚畯鍗犵紪璇戞椂闂達(dá)紝鑰屽嚱鏁板崰鎵ц鏃墮棿銆?br>(4)銆佸畯鍙傛暟涓嶅崰絀洪棿錛屽洜涓哄彧鍋氬瓧絎︿覆鏇挎崲錛岃屽嚱鏁拌皟鐢ㄦ椂鍙傛暟浼犻掓槸鍙橀噺涔嬮棿鐨勪紶閫掞紝褰㈠弬浣滀負(fù)灞閮ㄥ彉閲忓崰鍐呭瓨絀洪棿銆?br>(5)銆佸嚱鏁拌皟鐢ㄩ渶瑕佷繚鐣欑幇鍦猴紝鐒跺悗杞叆璋冪敤鍑芥暟鎵ц錛屾墽琛屽畬姣曞啀榪斿洖涓昏皟鍑芥暟錛岃繖浜涜楄垂鍦ㄥ畯涓槸娌℃湁鐨勩?/p>
浣跨敤瀹忓拰鍐呰仈鍑芥暟閮藉彲浠ヨ妭鐪佸湪鍑芥暟璋冪敤鏂歸潰鐨勬椂闂村拰絀洪棿寮閿銆備簩鑰呴兘鏄負(fù)浜嗘彁楂樻晥鐜囷紝浣嗘槸鍗存湁鐫鏄捐憲鐨勫尯鍒細(xì) (1)銆佸湪浣跨敤鏃訛紝瀹忓彧鍋氱畝鍗曠殑棰勫鐞嗗櫒絎﹀彿琛?瀛楃涓?涓殑綆鍗曟浛鎹€傝屽唴鑱斿嚱鏁板彲浠ヨ繘琛屽弬鏁扮被鍨嬫鏌ワ紝涓斿叿鏈夎繑鍥炲?涔熻兘琚己鍒惰漿鎹負(fù)鍙漿鎹㈢殑鍚堥傜被鍨?銆?br>(2)銆佸唴鑱斿嚱鏁伴鍏堟槸鍑芥暟錛屽嚱鏁扮殑璁稿鎬ц川閮介傜敤浜庡唴鑱斿嚱鏁?濡傚唴鑱斿嚱鏁板彲浠ラ噸杞?銆?br>(3)銆佸唴鑱斿嚱鏁板彲浠ヤ綔涓烘煇涓被鐨勬垚鍛樺嚱鏁幫紝榪欐牱鍙互浣跨敤綾葷殑淇濇姢鎴愬憳鍜岀鏈夋垚鍛樸傝屽綋涓涓〃杈懼紡娑夊強鍒扮被淇濇姢鎴愬憳鎴栫鏈夋垚鍛樻椂錛屽畯灝變笉鑳藉疄鐜頒簡(鏃犳硶灝唗his鎸囬拡鏀懼湪鍚堥備綅緗?銆?/p>
鍙互鐢ㄥ唴鑱斿嚱鏁板畬鍏ㄦ浛浠e畯銆?br>浣嗘槸鍦ㄤ嬌鐢ㄥ唴鑱斿嚱鏁版椂涔熻娉ㄦ剰錛氫綔涓哄唴鑱斿嚱鏁幫紝鍑芥暟浣撳繀欏誨崄鍒嗙畝鍗曪紝涓嶈兘鍖呭惈寰幆錛屾潯浠訛紝閫夋嫨絳夊鏉傜粨鏋勶紝鍚﹀垯涓嶈兘浣滀負(fù)鍐呰仈鍑芥暟銆?br>瀹為檯涓婏紝緙栬瘧鍣ㄧ殑浼樺寲緋葷粺浼?xì)鑷姩灏嗕竴浜涚畝鍗曞嚱鏁板彉鎴愬唴鑱斿嚱鏁般傝屼竴浜涘鏉傜殑鍑芥暟錛屽嵆浣挎寚瀹氫負(fù)鍐呰仈錛岀紪璇戝櫒涔熶細(xì)鑷姩褰撲綔鏅氬嚱鏁般?/p>
鏂囩珷鍑哄錛欴IY閮ㄨ惤(http://www.diybl.com/course/3_program/c++/cppxl/20081216/154041.html )
]]> 鍩烘湰鎺掑簭鏂規(guī)硶鍙婂垎鏋愶紙涔?jié)锛夊Q歊andomized-Quicksort蹇熸帓搴忕殑闅忔満鍖栫増鏈?/title> http://www.shnenglu.com/liyuxia713/archive/2010/01/24/106332.html騫歌繍鑽?/dc:creator>騫歌繍鑽?/author>Sun, 24 Jan 2010 06:36:00 GMT http://www.shnenglu.com/liyuxia713/archive/2010/01/24/106332.html http://www.shnenglu.com/liyuxia713/comments/106332.html http://www.shnenglu.com/liyuxia713/archive/2010/01/24/106332.html#Feedback 0 http://www.shnenglu.com/liyuxia713/comments/commentRss/106332.html http://www.shnenglu.com/liyuxia713/services/trackbacks/106332.html 濡備綍鏀硅繘Quicksort? 絳旀鏄細(xì)寮曡繘闅忔満鍖栨濇兂銆? 涓縐嶆柟娉曪細(xì) 瀵圭粰瀹氱殑寰呮帓搴忓簭鍒楋紝闅忔満鍦伴噸鎺掑垪
鍙︿竴縐嶆柟娉曪細(xì)闅忔満閫夊彇pivot
緇欏嚭絎簩縐嶆柟娉曠殑浠g爜 闃呰鍏ㄦ枃 ]]> Order Statistics 欏哄簭緇熻錛堟壘鍑虹i灝忓厓绱狅級 http://www.shnenglu.com/liyuxia713/archive/2010/01/21/106151.html騫歌繍鑽?/dc:creator>騫歌繍鑽?/author>Thu, 21 Jan 2010 08:29:00 GMT http://www.shnenglu.com/liyuxia713/archive/2010/01/21/106151.html http://www.shnenglu.com/liyuxia713/comments/106151.html http://www.shnenglu.com/liyuxia713/archive/2010/01/21/106151.html#Feedback 0 http://www.shnenglu.com/liyuxia713/comments/commentRss/106151.html http://www.shnenglu.com/liyuxia713/services/trackbacks/106151.html Order Statistics 欏哄簭緇熻
Select(int* a, int n, int ith): 浠庣粰瀹氱殑n涓厓绱犱腑鎵懼嚭絎琲涓皬鐨勫厓绱? 鎬濇兂錛歈uickSort鐨凱artition鏂規(guī)硶榪涜鍒嗗壊
濡傛灉 i = rank(pivot), 鍒欒繑鍥瀉[k]
濡傛灉 i < rank(pivot), 鍒欎粠鍓嶅崐閮ㄥ垎涓壘絎琲涓皬鐨勫厓绱? 濡傛灉 i > rank(pivot), 鍒欎粠鍚庡崐閮ㄥ垎涓壘絎琲-rank(pivot)涓皬鐨勫厓绱?
鏈鍧忚繍琛屾椂闂碠(n^2)
騫沖潎榪愯鏃墮棿O(nlgn) 闃呰鍏ㄦ枃 ]]> 青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
国产精品igao视频网网址不卡日韩 |
一区二区三区视频免费在线观看 |
一区二区三区三区在线 |
久久夜色撩人精品 |
国产一区自拍视频 |
在线观看欧美黄色 |
久久久久国产精品一区 |
午夜精品久久 |
欧美大片在线看 |
亚洲国产一区二区三区青草影视 |
久久日韩粉嫩一区二区三区 |
欧美亚洲一区三区 |
国产日韩欧美综合在线 |
午夜激情一区 |
亚洲女爱视频在线 |
亚洲国产黄色片 |
亚洲第一精品影视 |
久久久久久噜噜噜久久久精品 |
亚洲视频1区 |
国产精品久线观看视频 |
香蕉久久精品日日躁夜夜躁 |
99re66热这里只有精品3直播 |
欧美精品久久久久久久久老牛影院
|
免费一级欧美在线大片 |
在线观看一区二区视频 |
欧美国产亚洲视频 |
欧美超级免费视 在线 |
激情久久久久久 |
欧美h视频在线 |
欧美三级电影一区 |
久久久久久久久久久久久久一区
|
亚洲一区在线观看免费观看电影高清 |
国产精品一区二区久久国产 |
欧美成人高清 |
国产精品美女黄网 |
亚洲国产精品一区二区尤物区 |
国产精品成人一区二区艾草 |
老司机免费视频一区二区 |
欧美日韩一区二区三区视频 |
久久久久一区二区 |
欧美午夜在线视频 |
亚洲二区三区四区 |
激情五月婷婷综合 |
亚洲欧美日本日韩 |
一区二区三区视频在线 |
噜噜噜噜噜久久久久久91 |
欧美亚洲日本网站 |
欧美色道久久88综合亚洲精品 |
欧美mv日韩mv国产网站 |
国产免费成人av |
日韩视频永久免费 |
亚洲看片免费 |
久久综合网hezyo |
久久久中精品2020中文 |
国产精品一区久久久久 |
99精品热6080yy久久 |
亚洲欧洲综合另类 |
久久久人人人 |
久久综合99re88久久爱 |
国产视频自拍一区 |
亚洲一区二区免费视频 |
亚洲免费中文 |
国产精品初高中精品久久 |
日韩一级黄色片 |
一本色道久久综合 |
欧美伦理91i |
亚洲黄色免费电影 |
亚洲欧洲免费视频 |
欧美精品成人91久久久久久久 |
欧美成人午夜免费视在线看片 |
激情久久久久 |
米奇777在线欧美播放 |
欧美黄色一区 |
亚洲精品在线视频 |
欧美日韩精品在线 |
在线一区二区三区四区 |
午夜精品久久久久久久99黑人 |
国产精品久久久久久久久久久久久 |
一本久久青青 |
欧美一级久久久 |
国内精品久久久久影院 日本资源 |
久久国产福利国产秒拍 |
欧美va亚洲va国产综合 |
亚洲久久一区 |
国产精品第2页 |
羞羞色国产精品 |
欧美1区视频 |
亚洲视频一区二区在线观看 |
国产精品久久久久久亚洲调教 |
亚洲欧美成人 |
免费在线欧美视频 |
亚洲图片激情小说 |
国产日韩1区 |
久久综合伊人77777蜜臀 |
亚洲欧洲精品成人久久奇米网
|
国产酒店精品激情 |
久久精品夜色噜噜亚洲a∨ |
欧美激情a∨在线视频播放 |
在线综合+亚洲+欧美中文字幕 |
国产精品女人网站 |
玖玖玖免费嫩草在线影院一区 |
亚洲激情二区 |
久久er99精品 |
亚洲人精品午夜 |
国产精品一区二区在线观看 |
毛片基地黄久久久久久天堂 |
一区二区日本视频 |
欧美成人日本 |
欧美在线观看一区二区 |
亚洲国产免费看 |
国产精品美女久久久久久2018 |
久久久亚洲欧洲日产国码αv |
亚洲精品视频在线播放 |
久久综合九色综合网站 |
亚洲主播在线 |
91久久久国产精品 |
国产欧美婷婷中文 |
欧美久久综合 |
久久久久久97三级 |
午夜国产精品视频免费体验区 |
亚洲第一区色 |
久久婷婷久久一区二区三区 |
亚洲在线第一页 |
亚洲免费福利视频 |
在线观看欧美日本 |
国产午夜精品美女视频明星a级 |
欧美日韩国产一中文字不卡 |
久久综合色8888 |
久久国产精品色婷婷 |
亚洲欧美日韩系列 |
一区二区三区四区国产精品 |
亚洲成色777777女色窝 |
亚洲综合欧美日韩 |
亚洲国产裸拍裸体视频在线观看乱了中文
|
国产手机视频精品 |
欧美午夜视频在线观看 |
欧美日韩成人综合在线一区二区 |
巨乳诱惑日韩免费av |
欧美专区亚洲专区 |
欧美一区激情 |
欧美一区二区精品在线 |
亚洲在线观看视频网站 |
亚洲一级免费视频 |
亚洲一区网站 |
亚洲欧美日韩一区 |
欧美一区二区三区视频在线观看 |
一区二区三区www |
一区二区三区四区国产精品 |
一区二区国产日产 |
夜夜爽夜夜爽精品视频 |
宅男在线国产精品 |
亚洲在线视频 |
欧美一级一区 |
久久人人爽人人爽爽久久 |
久久这里只精品最新地址 |
久久中文字幕一区二区三区 |
久久综合狠狠综合久久综青草 |
久久亚洲一区 |
欧美激情按摩 |
欧美日韩中文字幕 |
国产精品青草久久久久福利99 |
国产毛片一区二区 |
在线欧美不卡 |
一级日韩一区在线观看 |
亚洲免费伊人电影在线观看av |
欧美亚洲在线播放 |
蜜臀91精品一区二区三区 |
亚洲国产精品一区二区尤物区 |
亚洲三级电影在线观看
|
老鸭窝亚洲一区二区三区 |
蜜臀av性久久久久蜜臀aⅴ四虎 |
欧美福利视频 |
在线一区二区三区做爰视频网站 |
性色av一区二区三区在线观看 |
久久久久国内 |
欧美日韩亚洲成人 |
国产亚洲毛片 |
日韩一级免费观看 |
欧美在线免费观看 |
亚洲国产另类久久精品 |
亚洲视频精品在线 |
鲁大师成人一区二区三区 |
欧美日韩国产成人在线91 |
国产亚洲综合性久久久影院 |
亚洲国产视频一区二区 |
亚洲欧美视频一区二区三区 |
欧美成人综合网站 |
亚洲天堂黄色 |
欧美国产第二页 |
国产午夜精品视频免费不卡69堂 |
亚洲精品国偷自产在线99热 |
欧美在线视频免费观看 |
亚洲日本免费电影 |
久久精品国亚洲 |
国产精品家教 |
亚洲最新色图 |
欧美a一区二区 |
欧美一区二区三区精品电影 |
欧美日韩中文精品 |
亚洲精品乱码久久久久久按摩观 |