锘??xml version="1.0" encoding="utf-8" standalone="yes"?>在线播放亚洲,亚洲免费在线观看,欧美va亚洲va日韩∨a综合色 http://www.shnenglu.com/liujiajia/category/7258.html瀛︿範銆佸伐浣溿佺敓媧伙紝榪欐槸涓変釜闂銆?/description>zh-cn Wed, 23 Jul 2008 09:32:46 GMT Wed, 23 Jul 2008 09:32:46 GMT 60 鏈綆鍗曠殑windows紼嬪簭 http://www.shnenglu.com/liujiajia/archive/2008/07/23/56963.html鍒樺姞鍔?/dc:creator>鍒樺姞鍔?/author>Wed, 23 Jul 2008 09:01:00 GMT http://www.shnenglu.com/liujiajia/archive/2008/07/23/56963.html http://www.shnenglu.com/liujiajia/comments/56963.html http://www.shnenglu.com/liujiajia/archive/2008/07/23/56963.html#Feedback 0 http://www.shnenglu.com/liujiajia/comments/commentRss/56963.html http://www.shnenglu.com/liujiajia/services/trackbacks/56963.html 1.鎵撳紑vc++; 2.閫夋嫨鑿滃崟鏍廸ile----new錛?br>3.閫夐」鍗¢夋嫨Projects錛?br>4.妯℃澘閫夋嫨 Win32 Application; 5.杈撳叆Project name錛?br>6.Loction 閫夋嫨璺緞錛?br>7.鐐瑰嚮OK緇х畫錛?br>8.閫夋嫨榛樿鐨?#8220;An Empty project”錛?br>9.鐐瑰嚮finish瀹屾垚鍒涘緩宸ョ▼錛?br>10.鍚戝伐紼嬮噷闈㈡坊鍔犱竴涓猚++鏂囦歡錛涳紙file--new--閫夐」鍗ile--C++ source file--杈撳叆鏂囦歡鍚?-鐐瑰嚮OK錛?br>11.杈撳叆浠ヤ笅浠g爜錛?/p>
#define WIN32_LEAN_AND_MEAN #include< windows.h > #include< windowsx.h > int WINAPI WinMain(HINSTANCE hinstance,HINSTANCE hprevinstance,LPSTR lpcmdline, int ncmdshow) { MessageBox(NULL, " Hello World! " , " first win " ,MB_OK | MB_ICONEXCLAMATION); return 0 ; }
12.淇濆瓨錛屾寜ctrl+F5緙栬瘧騫惰繍琛屻?br>13.寮瑰嚭涓涓璇濇銆?br> 浠ヤ笂灝辨槸鍙風О涓栫晫涓婃渶綆鍗曠殑Windows紼嬪簭錛?br>
]]> 鍑芥暟榪斿洖鍊肩殑鐗規(guī)畩鎯呭喌錛堣繑鍥炲紩鐢ㄣ侀潪寮曠敤銆佸紩鐢ㄥ乏鍊鹼級 http://www.shnenglu.com/liujiajia/archive/2008/07/16/56244.html鍒樺姞鍔?/dc:creator>鍒樺姞鍔?/author>Tue, 15 Jul 2008 16:41:00 GMT http://www.shnenglu.com/liujiajia/archive/2008/07/16/56244.html http://www.shnenglu.com/liujiajia/comments/56244.html http://www.shnenglu.com/liujiajia/archive/2008/07/16/56244.html#Feedback 0 http://www.shnenglu.com/liujiajia/comments/commentRss/56244.html http://www.shnenglu.com/liujiajia/services/trackbacks/56244.html 榪斿洖闈炲紩鐢?/span> string make_plural(size_t i,const string &word,const string &ending) { return (i==1)?word:word+ending; } 浠ヤ笂鍑芥暟錛屽綋i絳変簬1鏃訛紝鍑芥暟榪斿洖word褰㈠弬鐨勫壇鏈紱褰搃涓嶇瓑浜?鏃跺嚱鏁拌繑鍥炰竴涓復鏃剁殑string瀵硅薄錛岃繖涓復鏃跺璞℃槸鐢卞瓧絎︿覆word鍜宔nding鐩稿姞鑰屾垚鐨勩傝繖涓ょ鎯呭喌涓嬶紝return閮藉湪璋冪敤璇ュ嚱鏁扮殑鍦版柟闃插鍒朵簡榪斿洖鐨剆tring瀵硅薄銆?br>榪斿洖寮曠敤 const string &shorterString(const string &s1,const string &s2) { return s1.size()<s2.size()?s1:s2; } 浠ヤ笂鍑芥暟鐨勮繑鍥炲兼槸寮曠敤綾誨瀷銆傛棤璁鴻繑鍥瀞1鎴栨槸s2,璋冪敤鍑芥暟鍜岃繑鍥炵粨鏋滄椂錛岄兘娌℃湁澶嶅埗榪欎簺string瀵硅薄銆?br>鍗冧竾涓嶈榪斿洖灞閮ㄥ璞$殑寮曠敤 const string &mainip(const string &s) { string ret=s; return ret; } 褰撳嚱鏁版墽琛屽畬姣曪紝紼嬪簭灝嗛噴鏀懼垎閰嶇粰灞閮ㄥ璞$殑瀛樺偍絀洪棿銆傛鏃訛紝瀵瑰眬閮ㄥ璞$殑寮曠敤灝變細鎸囧悜涓嶇‘瀹氱殑鍐呭瓨銆傦紙鎴戝湪dev c++閲岃繍琛岄氳繃銆傘傘傘?浣嗘槸vc6鍜寁c2008涓嶈兘緙栬瘧閫氳繃錛夈傚悓鐞嗭紝涔熶笉鑳借繑鍥炲眬閮ㄥ璞$殑鎸囬拡銆?br> 寮曠敤榪斿洖宸﹀鹼紙姣旇緝濂囧錛?/strong> char &get_val(string &str,string::size_type ix) { return str[ix]; } 浣跨敤璇彞璋冪敤: string s("123456"); cout<<s<<endl; get_val(s,0)='a'; cout<<s<<endl; 鎶婂嚱鏁板簲鐢ㄤ簬宸﹀鹼紝榪樻槸絎竴嬈¤鍒幫紙鐪熸槸瀛ら檵瀵¢椈錛夈?br> 浠ヤ笅鏄笂闈㈠嚑縐嶆儏鍐電殑瀹炰緥浠g爜錛?br>
// liujiajia // 2008-7-16 #include < iostream > using namespace std; string make_plural(size_t, const string & , const string & ); const string & shorterString( const string & , const string & ); const string & mainip( const string & ); char & get_val( string & , string ::size_type); int main( void ) { cout << make_plural( 1 , " dog " , " s " ) << endl; cout << make_plural( 2 , " dog " , " s " ) << endl; string string1 = " 1234 " ; string string2 = " abc " ; cout << shorterString(string1,string2) << endl; cout << mainip( " jiajia " ) << endl; string s( " 123456 " ); cout << s << endl; get_val(s, 0 ) = ' a ' ; cout << s << endl; getchar(); return 0 ; } // 榪斿洖闈炲紩鐢?nbsp; string make_plural(size_t i, const string & word, const string & ending) { return (i == 1 ) ? word:word + ending; } // 榪斿洖寮曠敤 const string & shorterString( const string & s1, const string & s2) { return s1.size() < s2.size() ? s1:s2; } // 紱佹榪斿洖灞閮ㄥ璞$殑寮曠敤錛堟垜鐨刣ev c++ 娌℃湁鎶ラ敊錛屾瘮杈冨彲鎬曪級 const string & mainip( const string & s) { string ret = s; return ret; } // 寮曠敤榪斿洖宸﹀鹼紙絎竴嬈″惉璇達級 char & get_val( string & str, string ::size_type ix) { return str[ix]; }
]]> 鏁扮粍鐨勫艦鍙?/title> http://www.shnenglu.com/liujiajia/archive/2008/07/15/56143.html鍒樺姞鍔?/dc:creator>鍒樺姞鍔?/author>Mon, 14 Jul 2008 16:05:00 GMT http://www.shnenglu.com/liujiajia/archive/2008/07/15/56143.html http://www.shnenglu.com/liujiajia/comments/56143.html http://www.shnenglu.com/liujiajia/archive/2008/07/15/56143.html#Feedback 0 http://www.shnenglu.com/liujiajia/comments/commentRss/56143.html http://www.shnenglu.com/liujiajia/services/trackbacks/56143.html 紺轟緥錛?br> //褰㈠紡1 void printValues(const int ia[10]) //铏界劧褰㈠弬鎸囧畾浜嗘暟緇勭殑澶у皬錛屼絾緙栬瘧鏃朵笉浼氭鏌ュ疄鍙傛暟緇勫ぇ灝忥紝鍥犱負緙栬瘧鍣ㄥ彧媯鏌ュ艦鍙傛槸鍚︽槸鎸囬拡錛屽茍涓旀寚閽堢被鍨嬪拰鏁扮粍鍏冪礌鐨勭被鍨嬫槸鍚﹀尮閰嶃?br> { for(size_t i=0;i!=10;i++) { cout<<ia[i]<<endl; } } //褰㈠紡2 void printValues2(const int ia[],int size) { for(size_t i=0;i!=size;i++) { cout<<ia[i]<<endl; } } int main(void) { int i[10]={1,2,3,4,5,6,7,8,9,0}; printValues(i); //i浣滀負printValues鐨勫疄鍙傦紝鍦ㄨ繖閲屼負鏁扮粍i鐨勯鍦板潃錛屾垨鑰呰浠栬漿鎹負鎴愪竴涓寚閽?br> printValues2(i,10); } 鏁扮粍褰㈠弬鍙互瀹氫箟涓哄紩鐢ㄦ垨闈炲紩鐢ㄧ被鍨嬨傚ぇ閮ㄥ垎鎯呭喌涓嬶紝鏁扮粍浠ユ櫘閫氱殑闈炲紩鐢ㄧ被鍨嬩紶閫?姝ゆ椂鏁扮粍浼氭?zhèn)勬?zhèn)勭殑杞崲涓烘寚閽堛備竴鑸潵璇達紝闈炲紩鐢ㄧ被鍨嬬殑褰㈠弬浼氬垵濮嬪寲涓哄叾鐩稿簲瀹炲弬鐨勫壇鏈備絾鏄湪浼犻掓暟緇勬椂錛屽疄鍙傛槸鎸囧悜鏁扮粍絎竴涓厓绱犵殑鎸囬拡錛屽艦鍙傚鍒剁殑鏄繖涓寚閽堢殑鍊鹼紝鑰屼笉鏄暟緇勫厓绱犳湰韜傚嚱鏁版搷浣滅殑涔熸槸鎸囬拡鐨勫壇鏈紝鍥犳涓嶄細淇敼瀹炲弬鎸囬拡鐨勫箋傜劧鑰岋紝鍑芥暟鍙氳繃璇ユ寚閽堜慨鏀瑰畠鎵鎸囧悜鐨勬暟緇勫厓绱犵殑鍊箋?br> 浠ヤ笂浠g爜鍙互浣跨敤鎸囬拡琛ㄧず錛屾晥鏋滅瓑鍚岋細 void printValues3(const int *ia,int size) { for(size_t i=0;i!=size;i++,ia++) { cout<<*ia<<endl; } } 紺轟緥2錛堥氳繃寮曠敤浼犻掓暟緇勶級錛?br> void printValues4(int (&arr)[10]) //榪欑鎯呭喌涓嬶紝鏁扮粍澶у皬鎴愪負褰㈠弬鍜屽疄鍙傜殑涓閮ㄥ垎銆傜紪璇戝櫒浼氭鏌ユ暟緇勫ぇ灝忔槸鍚﹀尮閰嶃?nbsp;int (&arr)[10] 涓殑灝忔嫭鍙鋒槸蹇呴』鐨勩?br> { for(size_t i=0;i!=10;i++) { cout<<arr[i]<<endl; } } int main(void) { printValues4(i); } 鍜屽叾浠栫被鍨嬩竴鏍鳳紝鏁扮粍褰㈠弬鍙0鏄庝負鏁扮粍鐨勫紩鐢ㄣ傚鏋滃艦鍙傛槸鏁扮粍鐨勫紩鐢紝緙栬瘧鍣ㄤ笉浼氬皢鏁扮粍瀹炲弬杞寲涓烘寚閽堬紝鑰屾槸浼犻掓暟緇勭殑寮曠敤鏈韓銆?
]]> 浼犻掓寚鍚戞寚閽堢殑寮曠敤 http://www.shnenglu.com/liujiajia/archive/2008/07/14/56135.html鍒樺姞鍔?/dc:creator>鍒樺姞鍔?/author>Mon, 14 Jul 2008 14:19:00 GMT http://www.shnenglu.com/liujiajia/archive/2008/07/14/56135.html http://www.shnenglu.com/liujiajia/comments/56135.html http://www.shnenglu.com/liujiajia/archive/2008/07/14/56135.html#Feedback 0 http://www.shnenglu.com/liujiajia/comments/commentRss/56135.html http://www.shnenglu.com/liujiajia/services/trackbacks/56135.html
// liujiajia // 2008-7-14 #include < iostream > using namespace std; void ptrswap( int *& , int *& ); int main( void ) { int i = 10 ; int j = 20 ; int * pi =& i; int * pj =& j; cout << " 璋冪敤ptr()涔嬪墠:pi= " << pi << " ,*pi= " <<* pi << " ;pj= " << pj << " ,*pj= " <<* pj << endl; ptrswap(pi,pj); cout << " 璋冪敤ptr()涔嬪悗:pi= " << pi << " ,*pi= " <<* pi << " ;pj= " << pj << " ,*pj= " <<* pj << endl; getchar(); return 0 ; } void ptrswap( int *& v1, int *& v2) { int * temp = v1; v1 = v2; v2 = temp; }
鍦ㄨ皟鐢╬trswap涔嬪墠錛宲i鎸囧悜i,pj鎸囧悜j銆傚湪璋冪敤ptrswap涔嬪悗錛宲i鎸囧悜j,鑰宲j鎸囧悜浜唅銆?
]]> 浣跨敤寮曠敤褰㈠弬鐨勪紭鐐瑰拰娉ㄦ剰浜嬮」 http://www.shnenglu.com/liujiajia/archive/2008/07/14/56131.html鍒樺姞鍔?/dc:creator>鍒樺姞鍔?/author>Mon, 14 Jul 2008 13:48:00 GMT http://www.shnenglu.com/liujiajia/archive/2008/07/14/56131.html http://www.shnenglu.com/liujiajia/comments/56131.html http://www.shnenglu.com/liujiajia/archive/2008/07/14/56131.html#Feedback 0 http://www.shnenglu.com/liujiajia/comments/commentRss/56131.html http://www.shnenglu.com/liujiajia/services/trackbacks/56131.html 浣跨敤寮曠敤褰㈠弬鐨勪紭鐐癸細 鍦ㄥ悜鍑芥暟浼犻掑ぇ瀵硅薄鏃訛紝闇瑕佷嬌鐢ㄥ紩鐢ㄥ艦鍙傘傝櫧鐒惰祴鍊煎疄鍙傚浜庡唴緗暟鎹被鍨嬬殑瀵硅薄鎴栬呰妯¤緝?yōu)畯鐨劸c葷被鍨嬫潵璇存病鏈変粈涔堥棶棰橈紝浣嗘槸瀵逛簬澶ч儴鍒嗙殑綾葷被鍨嬫垨鑰呭ぇ鍨嬫暟緇勶紝瀹冪殑鏁堢巼灝辨瘮杈冧綆浜嗐傚彟澶栵紝鏌愪簺綾葷被鍨嬫槸鏃犳硶澶嶅埗鐨勩備嬌鐢ㄥ紩鐢ㄥ艦鍙傦紝鍑芥暟鍙互鐩存帴璁塊棶瀹炲弬瀵硅薄錛岃屾棤欏誨鍒跺畠銆?br> 紺轟緥錛?br> bool isShorter(const string &str1,const string &str2) { return str1.size()<str2.size(); } 鐢變簬string瀵硅薄鍙兘闈炲父鐨勯暱錛屾垜浠笇鏈涢伩鍏嶅鍒舵搷浣溿?br> 濡傛灉浣跨敤寮曠敤褰㈠弬鐨勫敮涓鐩殑鏄伩鍏嶅鍒跺艦鍙傦紝鍒欏簲灝嗗艦鍙傚畾涔変負const寮曠敤銆?br> 浣跨敤寮曠敤褰㈠弬搴旇娉ㄦ剰鐨勶細 int incr(int &val) { return ++val; } void main(void) { short v1=1; const int v2=10; int v3=20; incr(v1); //閿欒錛寁1涓嶆槸int incr(v2); //閿欒錛寁2鏄痗onst incr(v3); //姝g‘ incr(10); //閿欒 } 鎵浠ワ紝璋冪敤闈瀋onst綾誨瀷鐨勫紩鐢ㄥ艦鍙傦紝瀹炲弬蹇呴』涓嶆槸const綾誨瀷鐨勶紝鑰屼笖瀹炲弬鐨勭被鍨嬪拰褰㈠弬鐨勭被鍨嬪簲褰撲竴鑷淬?/p>
]]> 浣跨敤寮曠敤褰㈠弬榪斿洖棰濆鐨勪俊鎭?/title> http://www.shnenglu.com/liujiajia/archive/2008/07/14/56085.html鍒樺姞鍔?/dc:creator>鍒樺姞鍔?/author>Mon, 14 Jul 2008 04:12:00 GMT http://www.shnenglu.com/liujiajia/archive/2008/07/14/56085.html http://www.shnenglu.com/liujiajia/comments/56085.html http://www.shnenglu.com/liujiajia/archive/2008/07/14/56085.html#Feedback 2 http://www.shnenglu.com/liujiajia/comments/commentRss/56085.html http://www.shnenglu.com/liujiajia/services/trackbacks/56085.html 鍥犱負寮曠敤褰㈠弬鍦ㄥ嚱鏁拌皟鐢ㄥ悗鏄彲浠ヤ慨鏀瑰疄鍙傚肩殑錛屾墍浠ュ氨鐩稿綋涓庡嚱鏁扮殑榪斿洖鍊箋?br> 涓嬮潰鐨勪唬鐮佹紨紺轟簡涓涓甫鏈変竴涓繑鍥炲鹼紝騫墮氳繃寮曠敤褰㈠弬鍚戜富璋冨嚱鏁拌繑鍥炰俊鎭殑鍑芥暟銆傝繖涓嚱鏁扮殑鍔熻兘鏄壘鍑哄湪瀹瑰櫒涓煇涓涓暟鍊煎嚭鐜扮殑嬈℃暟錛屽茍榪斿洖璇ユ暟鍊肩涓嬈″嚭鐜扮殑榪唬鍣ㄣ?br>
// liujiajia // 2008-7-14 #include < iostream > #include< vector > using namespace std; vector < int > ::const_iterator find_val(vector < int > ::const_iterator,vector < int > ::const_iterator, int ,vector < int > ::size_type & ); int main( void ) { vector < int > some; int val; // 浣跨敤push_back()杈撳叆瀹瑰櫒涓殑鍊?nbsp; while (cin >> val) { some.push_back(val); } // 瀛樺偍鍊煎嚭鐜扮殑嬈℃暟 vector < int > ::size_type ccurs; // 璋冪敤鍑芥暟 vector < int > ::const_iterator it = find_val(some.begin(),some.end(), 8 ,ccurs); cout << ccurs << endl; getchar(); } vector < int > ::const_iterator find_val( vector < int > ::const_iterator beg, vector < int > ::const_iterator end, int value, vector < int > ::size_type & occurs) { vector < int > ::const_iterator res_iter = end; occurs = 0 ; for (;beg != end; ++ beg) { if ( * beg == value) { // 榪欎釜if璇彞鐨勪綔鐢ㄦ槸璁﹔es_iter絳変簬鍊肩涓嬈″嚭鐜扮殑浣嶇疆 if (res_iter == end) { res_iter = beg; } occurs ++ ; } } return res_iter; }
]]> 鍑芥暟鐨勫艦鍙傦紙闈炲紩鐢ㄥ艦鍙傘佹寚閽堝艦鍙傘佸紩鐢ㄥ艦鍙傦級 http://www.shnenglu.com/liujiajia/archive/2008/07/14/56054.html鍒樺姞鍔?/dc:creator>鍒樺姞鍔?/author>Sun, 13 Jul 2008 16:30:00 GMT http://www.shnenglu.com/liujiajia/archive/2008/07/14/56054.html http://www.shnenglu.com/liujiajia/comments/56054.html http://www.shnenglu.com/liujiajia/archive/2008/07/14/56054.html#Feedback 2 http://www.shnenglu.com/liujiajia/comments/commentRss/56054.html http://www.shnenglu.com/liujiajia/services/trackbacks/56054.html void add1(int v1) { v1+=1; } 榪欐槸鏈鏅氱殑褰㈠弬鏂瑰紡錛屽綋鍑芥暟琚皟鐢ㄦ椂錛屽疄鍙傜殑鍓湰鍒濆鍖栧艦鍙傦紝鍑芥暟騫舵病鏈夎闂皟鐢ㄦ墍浼犻掔殑瀹炲弬錛屽洜姝1+=1涓嶄細淇敼瀹炲弬鐨勫箋傚v1鐨勬搷浣滃彧鏄慨鏀逛簡瀹炲弬鐨勪竴涓壇鏈?br> 浜屻佹寚閽堝艦鍙?br> void add2(int *p) { *p+=1; p+=1; } 浣跨敤鎸囬拡鍋氫負鍑芥暟鐨勫艦鍙傦紝鍚屾牱鎸囬拡鐨勫鹼紙鎸囬拡鐨勫湴鍧錛変笉浼氬洜涓簆+=1鑰屽彈鍒板獎鍝嶏紝浣嗘槸鎸囬拡鎸囧悜鐨勫湴鍧鐨勫鹼紙*p錛夊皢浼氭敼鍙樸傛墍浠ヨ鎯充慨鏀瑰疄鍙傜殑鍊鹼紝鍙互浣跨敤榪欑鏂規(guī)硶銆備絾鏄繕鏈変竴縐嶆洿瀹夊叏鏇磋嚜鐒剁殑鏂規(guī)硶-寮曠敤褰㈠弬 涓夈佸紩鐢ㄥ艦鍙?br> void swap(int &a,int &b) { int temp=a; a=b; b=temp; } 寮曠敤褰㈠弬鐩存帴鍏寵仈鍒板叾鎵緇戝畾鐨勫璞★紝鑰岄潪榪欎簺瀵硅薄鐨勫壇鏈?鎵浠ヨ繖縐嶆柟娉曞彲浠ヤ慨鏀瑰疄鍙傜殑鍊鹼紝鑰屼笖鏇村姞鐩磋銆?br> 涓夌鏂規(guī)硶瀹炰緥浠g爜錛?br>
// liujiajia // 2008-7-14 #include < iostream > using namespace std; void add1( int ); void add2( int * ); void swap( int & , int & ); int main( void ) { int n = 10 ; cout << " 璋冪敤add1()涔嬪墠n= " << n << endl; add1(n); cout << " 璋冪敤add1()涔嬪悗n= " << n << endl; int * p =& n; cout << " 璋冪敤add2()涔嬪墠n= " << n << " ,p= " << p << endl; add2(p); cout << " 璋冪敤add2()涔嬪悗n= " << n << " ,p= " << p << endl; int a = 1 ,b = 2 ; cout << " 璋冪敤swap()涔嬪墠a= " << a << " ,b= " << b << endl; swap(a,b); cout << " 璋冪敤swap()涔嬪悗a= " << a << " ,b= " << b << endl; getchar(); } // 闈炲紩鐢ㄥ艦鍙?nbsp; void add1( int v1) { v1 += 1 ; } // 鎸囬拡褰㈠弬 void add2( int * p) { * p += 1 ; p += 1 ; } // 寮曠敤褰㈠弬 void swap( int & a, int & b) { int temp = a; a = b; b = temp; }
]]> const鍜屾寚閽堬紙鎸囧悜const瀵硅薄鐨勬寚閽堛乧onst鎸囬拡錛?/title> http://www.shnenglu.com/liujiajia/archive/2008/06/21/54166.html鍒樺姞鍔?/dc:creator>鍒樺姞鍔?/author>Fri, 20 Jun 2008 16:13:00 GMT http://www.shnenglu.com/liujiajia/archive/2008/06/21/54166.html http://www.shnenglu.com/liujiajia/comments/54166.html http://www.shnenglu.com/liujiajia/archive/2008/06/21/54166.html#Feedback 0 http://www.shnenglu.com/liujiajia/comments/commentRss/54166.html http://www.shnenglu.com/liujiajia/services/trackbacks/54166.html 1.鎸囧悜const瀵硅薄鐨勬寚閽?/strong> const int *p; 榪欎釜p鏄竴涓寚鍚慽nt綾誨瀷const瀵硅薄鐨勬寚閽堬紝const闄愬畾浜嗘寚閽坧鎵鎸囧悜鐨勭被鍨嬶紝鑰屽茍闈瀙鏈韓銆備篃灝辨槸璇磒鏈韓騫朵笉鏄痗onst銆傚湪瀹氫箟鏃朵笉闇瑕佸瀹冭繘琛屽垵濮嬪寲錛岃繕鍙互緇檖閲嶆柊璧嬪鹼紝浣垮叾鎸囧悜鍙︿竴涓猚onst瀵硅薄銆備絾涓嶈兘閫氳繃p淇敼鎵鎸囧悜瀵硅薄鐨勫箋?br>紺轟緥1錛歩nt a=0; p=&a; 鍙互銆?br>紺轟緥2錛?p=20; 涓嶅彲浠ャ?br>緇撹錛氳繖縐嶆寚鍚慶onst瀵硅薄鐨勬寚閽堝彧鏄檺鍒朵笉鑳戒慨鏀筽鎸囧悜瀵硅薄鐨勬暟鍊鹼紝鑰屼笉鏄檺鍒秔鎸囧悜浠涔堝璞°?br> 鎶婁竴涓猚onst瀵硅薄鐨勫湴鍧璧嬬粰涓涓笉鏄寚鍚慶onst瀵硅薄鐨勬寚閽堜篃鏄笉琛岀殑銆?br>紺轟緥3錛歝onst int b=10; int *p2=&b; //error const int *p3=&b; //ok 緇撹錛氬洜涓哄彉閲廱鏈塩onst淇グ錛屼笉鑳借淇敼銆備絾鎸囬拡p2鏄竴涓櫘閫氱殑鎸囬拡錛屽彲浠ヤ慨鏀規(guī)寚鍚戝璞$殑鍊鹼紝涓ょ澹版槑鐭涚浘錛屾墍浠ヤ笉鍚堟硶銆傝屾寚鍚慶onst瀵硅薄鐨勬寚閽堜笉鍏佽淇敼鎸囬拡鎸囧悜瀵硅薄鐨勬暟鍊鹼紝鎵浠ヨ繖縐嶆柟寮忓悎娉曘?br>2.const鎸囬拡 int c=20; int *const p4=&c; 鎸囬拡p4縐頒負const鎸囬拡銆傚畠鍜屾寚鍚慶onst瀵硅薄鐨勬寚閽堟伆濂界浉鍙嶏紝瀹冧笉鑳藉淇敼鎵鎸囧悜瀵硅薄錛屼絾鍗磋兘澶熶慨鏀規(guī)寚鍚戝璞$殑鏁板箋傚彟澶栵紝榪欑鎸囬拡鍦ㄥ0鏄庢椂蹇呴』鍒濆鍖栥?br>3.鎸囧悜const瀵硅薄鐨刢onst鎸囬拡 const int d=30; const int *const dp=&d; 鎸囬拡dp鏃笉鑳戒慨鏀規(guī)寚鍚戠殑瀵硅薄錛屼篃涓嶈兘淇敼鍙兂瀵硅薄鐨勫箋?
]]> 鏍囧噯搴?bitset 綾誨瀷 http://www.shnenglu.com/liujiajia/archive/2008/06/06/52400.html鍒樺姞鍔?/dc:creator>鍒樺姞鍔?/author>Fri, 06 Jun 2008 15:04:00 GMT http://www.shnenglu.com/liujiajia/archive/2008/06/06/52400.html http://www.shnenglu.com/liujiajia/comments/52400.html http://www.shnenglu.com/liujiajia/archive/2008/06/06/52400.html#Feedback 0 http://www.shnenglu.com/liujiajia/comments/commentRss/52400.html http://www.shnenglu.com/liujiajia/services/trackbacks/52400.html bitset瀵硅薄鐨勫畾涔夊拰鍒濆鍖?br> bitset<n> b; b鏈塶浣嶏紝姣忎綅閮芥槸0錛?br>bitset<n> b(u); b鏄痷nsigned long鍨媢鐨勫壇鏈紱 bitset<n> b(s); b鏄痵tring瀵硅薄s涓惈鏈夌殑浣嶄覆鐨勫壇鏈紱 bitset<n> b(s,pos,n); b鏄痵涓粠浣嶇疆pos寮濮嬬殑n涓綅鐨勫壇鏈紱 紺轟緥錛?br> bitset<16> bitvec1(0xffff); //bitvec1鐨?-15浣嶉兘鏄? bitset<32> bitvec2(0xffff); //bitvec2鐨?-15涓烘槸1錛?6-31鏄? bitset<128> bitvec3(0xffff); //bitvec3鐨?-15浣嶆槸1錛?6-127閮芥槸0 string str("1100"); bitset<32> bitvec4(str); //bitvec4鐨勭2銆佺3浣嶆槸1錛屽叾浣欓兘鏄?銆傚洜涓簊tring瀵硅薄鍜宐itset瀵硅薄涔嬮棿鏄弽鍚戣漿鍖栫殑錛歴tring瀵硅薄鐨勬渶鍙寵竟瀛楃錛堝嵆涓嬫爣鏈澶х殑閭d釜瀛楃錛夌敤鏉ュ垵濮嬪寲bitset瀵硅薄鐨勪綆浠蜂綅錛堝嵆灝忔爣涓?鐨勪綅錛?br> bitset瀵硅薄鐨勬搷浣滐細 b.any() b涓槸鍚﹀瓨鍦ㄧ疆涓?鐨勪簩榪涘埗浣嶏紵 b.none() b涓笉瀛樺湪緗負1鐨勪簩榪涘埗浣嶅悧錛?br>b.count() b涓間負1鐨勪簩榪涘埗浣嶇殑涓暟 b.size() b涓簩榪涘埗浣嶇殑涓暟 b[pos] 璁塊棶b涓湪pos澶勭殑浜岃繘鍒朵綅 b.test(pos) b涓湪pos澶勭殑浜岃繘鍒朵綅鏄惁涓?錛?br>b.set() 鎶奲涓墍鏈夌殑浜岃繘鍒朵綅閮界疆涓? b.set(pos) 鎶奲涓湪pos澶勭殑浜岃繘鍒朵綅緗負1 b.reset() 鎶奲涓墍鏈夌殑浜岃繘鍒朵綅閮界疆涓? b.reset(pos) 鎶奲涓湪pos澶勭殑浜岃繘鍒朵綅緗負0 b.flip() 鎶奲涓墍鏈変簩榪涘埗浣嶉愪綅鍙栧弽 b.flip(pos) 鎶奲涓湪pos澶勭殑浜岃繘鍒朵綅鍙栧弽 b.to_ulong() 鐢╞涓悓鏍風殑浜岃繘鍒朵綅榪斿洖涓涓猽nsigned long鍊?br>os<<b 鍚涓殑浣嶉泦杈撳嚭鍒皁s嫻?br>
]]> 榪唬鍣?iterator http://www.shnenglu.com/liujiajia/archive/2008/06/06/52399.html鍒樺姞鍔?/dc:creator>鍒樺姞鍔?/author>Fri, 06 Jun 2008 14:32:00 GMT http://www.shnenglu.com/liujiajia/archive/2008/06/06/52399.html http://www.shnenglu.com/liujiajia/comments/52399.html http://www.shnenglu.com/liujiajia/archive/2008/06/06/52399.html#Feedback 2 http://www.shnenglu.com/liujiajia/comments/commentRss/52399.html http://www.shnenglu.com/liujiajia/services/trackbacks/52399.html 榪唬鍣?/strong>(iterator)鏄竴涓鏌ュ鍣ㄥ唴鍏冪礌騫墮亶鍘嗗厓绱犵殑鏁版嵁綾誨瀷銆?br> 姣忕瀹瑰櫒綾誨瀷閮藉畾涔変簡鑷繁鐨勮凱浠e櫒綾誨瀷錛屽vector: vector<int>::iterator iter;榪欐潯璇彞瀹氫箟浜嗕竴涓悕涓篿ter鐨勫彉閲忥紝瀹冪殑鏁版嵁綾誨瀷鏄敱vector<int>瀹氫箟鐨刬terator綾誨瀷銆?br>浣跨敤榪唬鍣ㄨ鍙杤ector涓殑姣忎竴涓厓绱狅細 vector<int> ivec(10,1); for(vector<int>::iterator iter=ivec.begin();iter!=ivec.end();++iter) { *iter=2; //浣跨敤 * 璁塊棶榪唬鍣ㄦ墍鎸囧悜鐨勫厓绱?br> }const_iterator: 鍙兘璇誨彇瀹瑰櫒涓殑鍏冪礌錛岃屼笉鑳戒慨鏀廣?br> for(vector<int>::const_iterator citer=ivec.begin();citer!=ivec.end();citer++) { cout<<*citer; //*citer=3; error }vector<int>::const_iterator 鍜?const vector<int>::iterator鐨勫尯鍒?br> const vector<int>::iterator newiter=ivec.begin(); *newiter=11; //鍙互淇敼鎸囧悜瀹瑰櫒鐨勫厓绱?br> //newiter++; //榪唬鍣ㄦ湰韜笉鑳借淇敼 iterator鐨勭畻鏈搷浣滐細 iterator闄や簡榪涜++,--鎿嶄綔錛屽彲浠ュ皢iter+n,iter-n璧嬬粰涓涓柊鐨刬teraor瀵硅薄銆傝繕鍙互浣跨敤涓涓猧terator鍑忓幓鍙﹀涓涓猧terator. const vector<int>::iterator newiter=ivec.begin(); vector<int>::iterator newiter2=ivec.end(); cout<<"\n"<<newiter2-newiter ;
]]> 璁よ瘑鏍囧噯搴搗ector綾誨瀷 http://www.shnenglu.com/liujiajia/archive/2008/06/02/51928.html鍒樺姞鍔?/dc:creator>鍒樺姞鍔?/author>Mon, 02 Jun 2008 15:48:00 GMT http://www.shnenglu.com/liujiajia/archive/2008/06/02/51928.html http://www.shnenglu.com/liujiajia/comments/51928.html http://www.shnenglu.com/liujiajia/archive/2008/06/02/51928.html#Feedback 0 http://www.shnenglu.com/liujiajia/comments/commentRss/51928.html http://www.shnenglu.com/liujiajia/services/trackbacks/51928.html vector 鏄竴涓被妯℃澘(class template)銆?br>vector鐨勫畾涔夊拰鍒濆鍖栵細 vector<string> text; //淇濆瓨綾誨瀷涓簊tring鐨勫璞★紝榛樿鏋勯犲嚱鏁皌ext涓虹┖ vector<string> text2(10); //淇濆瓨綾誨瀷涓簊tring鐨勫璞★紝鍖呭惈10涓┖瀛楃涓?br> vector<int> ive(10,9); //淇濆瓨int鐨勫璞★紝淇濆瓨10涓間負9鐨勬暣褰㈠彉閲?br> vector<int> ive2(ive); //浣跨敤ive鍒濆鍖杋ve2鍚憊ector娣誨姞鍏冪礌錛?br> while(cin>>word) { text.push_back (word); //浣跨敤push_back鍙互鍚憊ector鐨勫悗闈㈡彃鍏ユ柊鐨勫厓绱犮?br> } 娉ㄦ剰錛?vector瀵硅薄錛堜互鍙婂叾浠栨爣鍑嗗簱瀹瑰櫒瀵硅薄錛夌殑閲嶈灞炴у氨鍦ㄤ簬鍙互鍦ㄨ繍琛屾椂楂樻晥鐨勬坊鍔犲厓绱狅紝鍥犱負vector澧為暱鏁堢巼楂橈紝鍦ㄥ厓绱犲煎凡鐭ョ殑鎯呭喌涓嬶紝鏈濂芥槸鍔ㄦ佺殑娣誨姞鍏冪礌銆?br> *铏界劧鍙互瀵圭粰瀹氬厓绱犱釜鏁扮殑vector瀵硅薄棰勫厛鍒嗛厤鍐呭瓨錛屼絾鏇存湁鏁堢殑鏂規(guī)硶鏄垵濮嬪寲涓涓┖vector瀵硅薄錛岀劧鍚庡啀鍔ㄦ佺殑澧炲姞鍏冪礌銆?br>vector鐨勪笅鏍囨搷浣滐細 for(vector<string>::size_type ix=0;ix!=text.size ();++ix) { cout<<text[ix] <<endl; } *浣跨敤vector<string>::size_type綾誨瀷鍙互鎺ユ敹vector<string>綾誨瀷鐨勫ぇ灝忋?br>*涓嶅湪for寰幆涔嬪墠鍙栧緱vector鐨勫ぇ灝忥紝鑰屽湪for寰幆涓綆梩ext.size()錛屾槸鍥犱負vector鏄彲浠ュ闀跨殑錛屾墍浠ュ畠鐨勫厓绱犳暟鐩槸涓嶇‘瀹氱殑銆?br>*鍜宻tring瀵硅薄涓鏍鳳紝vector鍙互閫氳繃涓嬫爣鐩存帴璁塊棶鍏冪礌銆?br>闄勮〃錛歷ector鎿嶄綔
v.empty()
濡傛灉v涓虹┖錛屽垯榪斿洖true
v.size()
榪斿洖v涓厓绱犵殑涓暟
v.push_back(t)
闇鎸変笉榪噕鐨勬湯灝懼鍔犱竴涓間負t鐨勫厓绱?/td>
v[n]
榪斿洖v涓綅緗負n鐨勫厓绱?/td>
v1=v2
鍚1鐨勫間笌鏇挎崲涓簐2涓厓绱犵殑鍓湰
v1==v2
濡傛灉v1涓巚2鐩哥瓑錛屽垯榪斿洖true
!=,<,<=,>,>=
淇濇寔榪欎簺鎿嶄綔絎︽儻鏈夌殑鍚箟
]]> c++瀛楃澶勭悊 cctype http://www.shnenglu.com/liujiajia/archive/2008/06/01/51853.html鍒樺姞鍔?/dc:creator>鍒樺姞鍔?/author>Sun, 01 Jun 2008 15:45:00 GMT http://www.shnenglu.com/liujiajia/archive/2008/06/01/51853.html http://www.shnenglu.com/liujiajia/comments/51853.html http://www.shnenglu.com/liujiajia/archive/2008/06/01/51853.html#Feedback 2 http://www.shnenglu.com/liujiajia/comments/commentRss/51853.html http://www.shnenglu.com/liujiajia/services/trackbacks/51853.html
isalnum(c)
濡傛灉c鏄瓧姣嶆垨鏁板瓧錛屽垯涓簍rue
isalpah(c)
濡傛灉c鏄瓧姣嶏紝鍒欎負true
iscntrl(c)
濡傛灉c鏄帶鍒跺瓧絎︼紝鍒欎負true
isdigit(c)
濡傛灉c鏄暟瀛楋紝鍒欎負true
isgraph(c)
濡傛灉c涓嶆槸絀烘牸錛屽垯涓簍rue
islower(c)
濡傛灉c鏄皬鍐欏瓧姣嶏紝鍒欎負true
isprint(c)
濡傛灉c鏄彲鎵撳嵃鐨勫瓧絎︼紝鍒欎負true
ispunct(c)
濡傛灉c鏄爣鐐圭鍙鳳紝鍒欎負true
isspace(c)
濡傛灉c鏄┖鐧藉瓧絎︼紝鍒欎負true
isupper(c)
濡傛灉c鏄ぇ浜涘瓧姣嶏紝鍒欎負true
isxdigit(c)
濡傛灉c鏄崄鍏繘鍒舵暟錛屽垯涓簍rue
tolower(c)
濡傛灉c鏄ぇ鍐欏瓧姣嶏紝鍒欒繑鍥炲皬鍐欏瓧姣嶅艦寮忥紝鍚﹀垯榪斿洖c銆?/td>
toupper(c)
濡傛灉c鏄皬鍐欏瓧姣嶏紝鍒欒繑鍥炲ぇ浜涘瓧姣嶅艦寮忥紝鍚﹀垯榪斿洖c銆?/td>
]]> string瀵硅薄鐨勬搷浣?size() empty() 鍏崇郴榪愮畻 璧嬪?涓嬫爣璁塊棶 http://www.shnenglu.com/liujiajia/archive/2008/06/01/51849.html鍒樺姞鍔?/dc:creator>鍒樺姞鍔?/author>Sun, 01 Jun 2008 15:22:00 GMT http://www.shnenglu.com/liujiajia/archive/2008/06/01/51849.html http://www.shnenglu.com/liujiajia/comments/51849.html http://www.shnenglu.com/liujiajia/archive/2008/06/01/51849.html#Feedback 0 http://www.shnenglu.com/liujiajia/comments/commentRss/51849.html http://www.shnenglu.com/liujiajia/services/trackbacks/51849.html string瀵硅薄鐨勬搷浣滐細 size(): 鐢ㄦ潵鑾峰彇瀛楃涓茬殑闀垮害銆?br>杈撳嚭瀛楃涓瞫鐨勯暱搴︼細 string s("hello world!\n"); cout<<"the size of '"<<s<<"' is"<<s.size ()<<endl; 鍒ゆ柇瀛楃涓叉槸鍚︿負絀虹殑涓ょ鏂瑰紡錛?br> if(s.size ()==0) { cout<<"s.size==0"<<endl; } if(s.empty ()) { cout<<"s.empty()"<<endl; }鑾峰緱瀛楃涓查暱搴︼細 int num=s.size(); 浣跨敤鏁村艦鎺ユ敹瀛楃涓查暱搴﹀彲鑳戒細鏈夐棶棰橈紝鍥犱負int鍙橀噺鐨勮〃紺鴻寖鍥村お灝忥紝鏈夋椂涓嶈兘瀛樺偍string瀵硅薄鐨勯暱搴︺備嬌鐢╯tring::size_type綾誨瀷鍙互婊¤凍瑕佹眰錛岃繖縐嶇被鍨嬫槸unsigned鐨勶紝榪欐瘮signed綾誨瀷瑕佸ぇ涓鍊嶃備簨瀹炰笂size()鍑芥暟榪斿洖鐨勪篃鏄?size_type 綾誨瀷銆?br>鍏崇郴榪愮畻錛?br> 鍙互浣跨敤錛歴1==s2錛泂1>s2錛泂1<s2錛屾潵姣旇緝涓や釜瀛楃涓層?br>璧嬪艱繍綆楋細 string snew="empty"; snew=s1; 涓婇潰浠g爜棣栧厛鍒濆鍖栦竴涓猻new瀛楃涓詫紝絎簩鍙ュ皢snew鍗犵敤鐨勫唴瀛橀噴鏀炬帀錛岀劧鍚庣粰snew瓚沖瀛樻斁s1鍓湰鐨勫唴瀛樼┖闂達紝鏈鍚庢妸s1涓墍鏈夌殑瀛楃澶嶅埗鍒版柊鍒嗛厤鐨勫唴瀛樼┖闂淬?br>瀛楃涓茶繛鎺ワ細 cout<<s1+"."<<endl; OK cout<<"1"+s1<<endl; OK cout<<s1+s2<<endl; OK cout<<s1+s2+"."<<endl; OK //cout<<"hello"+"jiajia"<<endl; ERROR 褰撹繘琛宻tring瀵硅薄鍜屽瓧絎︿覆瀛楅潰鍊兼販鍚堣繛鎺ユ搷浣滄椂錛?鎿嶄綔絎︾殑宸﹀彸鎿嶄綔鏁板繀欏昏嚦灝戞湁涓涓槸string綾誨瀷鐨勩?br>閫氳繃涓嬫爣璁塊棶string瀵硅薄錛?/strong> string瀵硅薄涓嬫爣浠?寮濮嬨?br> for(string::size_type ix=0;ix<s1.size();ix++) { s1[ix]+=ix; }
]]> 瀛楃涓茬殑璇誨彇 cin 鍜?getline() http://www.shnenglu.com/liujiajia/archive/2008/06/01/51716.html鍒樺姞鍔?/dc:creator>鍒樺姞鍔?/author>Sat, 31 May 2008 16:02:00 GMT http://www.shnenglu.com/liujiajia/archive/2008/06/01/51716.html http://www.shnenglu.com/liujiajia/comments/51716.html http://www.shnenglu.com/liujiajia/archive/2008/06/01/51716.html#Feedback 0 http://www.shnenglu.com/liujiajia/comments/commentRss/51716.html http://www.shnenglu.com/liujiajia/services/trackbacks/51716.html cin string s; cout<<"Enter some words..."; cin >>s; cout<<"You write:"<<s<<endl; *璇誨彇騫跺拷鐣ュ紑澶存墍鏈夌殑絀虹櫧瀛楃錛堢┖鏍箋佹崲琛岀銆佸埗琛ㄧ錛夈?br>*璇誨彇瀛楃鐩磋嚦閬囧埌絀虹櫧瀛楃錛岃鍙栫粓姝€?br>getline() string line; cout<<"Enter a line..."; getline(cin,line); cout<<"You write:"<<line<<endl; *榪欎釜鍑芥暟鎺ユ敹涓や釜鍙傛暟錛岀涓涓槸杈撳叆嫻佸璞★紝絎簩涓槸string瀵硅薄銆?br>*getline涓嶅拷鐣ヨ寮澶寸殑鎹㈣絎︼紝鍙getline()閬囧埌鎹㈣絎︼紝鍝曟槸絎竴涓瓧絎︼紝getline涔熷皢鍋滄璇誨彇瀛楃騫惰繑鍥炪?br>*鑳藉璇誨彇闄ゆ崲琛屼箣澶栫殑絀虹櫧瀛楃銆?br>
]]> c++鍒濆鍖栧瓧絎︿覆鐨勬柟寮?/title> http://www.shnenglu.com/liujiajia/archive/2008/05/31/51714.html鍒樺姞鍔?/dc:creator>鍒樺姞鍔?/author>Sat, 31 May 2008 15:48:00 GMT http://www.shnenglu.com/liujiajia/archive/2008/05/31/51714.html http://www.shnenglu.com/liujiajia/comments/51714.html http://www.shnenglu.com/liujiajia/archive/2008/05/31/51714.html#Feedback 0 http://www.shnenglu.com/liujiajia/comments/commentRss/51714.html http://www.shnenglu.com/liujiajia/services/trackbacks/51714.html
#include < iostream > #include< string > using namespace std; int main( void ) { string s1; // 鍒濆鍖栦負絀哄瓧絎︿覆 string s2( " hello " ); // 鍒濆鍖栦負涓涓瓧絎︿覆瀛楅潰鍓湰 string s3(s2); // 灝唖3鍒濆鍖栦負涓涓猻2鐨勫壇鏈?nbsp; string s4 = " hi jiajia " ; // 鍒濆鍖栦負涓涓瓧絎︿覆瀛楅潰鍓湰 string s5( 15 , ' A ' ); cout << s1 << endl << s2 << endl << s3 << endl << s4 << endl << s5 << endl; system( " pause " ); return 0 ; }
娉ㄦ剰錛氱敱浜庡巻鍙插師鍥犱互鍙婁負浜嗕笌C璇█鍏煎錛屽瓧絎︿覆瀛楅潰鍊間笌鏍囧噯搴搒tring綾誨瀷涓嶆槸鍚屼竴縐嶇被鍨嬨?
]]> 鍛藉悕絀洪棿鐨剈sing澹版槑 http://www.shnenglu.com/liujiajia/archive/2008/05/31/51713.html鍒樺姞鍔?/dc:creator>鍒樺姞鍔?/author>Sat, 31 May 2008 15:36:00 GMT http://www.shnenglu.com/liujiajia/archive/2008/05/31/51713.html http://www.shnenglu.com/liujiajia/comments/51713.html http://www.shnenglu.com/liujiajia/archive/2008/05/31/51713.html#Feedback 0 http://www.shnenglu.com/liujiajia/comments/commentRss/51713.html http://www.shnenglu.com/liujiajia/services/trackbacks/51713.html : : 鎿嶄綔絎︽槸浣滅敤鍩熻В鏋愮銆傚畠鐨勫惈涔夋槸鍙蟲搷浣滄暟鐨勫悕瀛楀彲浠ュ湪宸︽搷浣滄暟鐨勪綔鐢ㄥ煙涓壘鍒般俿td::cout 鐨勬剰鎬濇槸璇存墍闇鍚嶅瓧cin鏄湪鍛藉悕絀洪棿std涓畾涔夌殑銆傝繖縐嶇鍙峰紩鐢ㄦ爣鍑嗗簱鍚嶅瓧鐨勬柟寮忔槸闈炲父楹葷儲鐨勩?br> c++鎻愪緵浜嗕竴縐嶇畝鍗曠殑鏂瑰紡鏉ヤ嬌鐢ㄥ懡鍚嶇┖闂存垚鍛橈紝using澹版槑銆傝繖鏄竴縐嶆渶瀹夊叏鐨勬満鍒躲?br>
#include < string > #include< iostream > using std::cin; using std::endl; using std:: string ; int main( void ) { string s; // 姝g‘銆俿tring浣跨敤浜唘sing澹版槑 cin >> s; // 姝g‘銆俢in浣跨敤浜唘sing澹版槑 cout << s; // 閿欒銆俢out娌℃湁浣跨敤using澹版槑 std::cout << s << endl; // 姝g‘銆傛寚瀹氫簡鍛藉悕絀洪棿 system( " pause " ); return 0 ; }
鍛藉悕絀洪棿鎵╁睍錛?/strong> 鍦ㄦ爣鍑咰++浠ュ墠錛岄兘鏄敤#include<iostream.h>榪欐牱鐨勫啓娉曠殑錛屽洜涓鴻鍖呭惈榪涙潵鐨勫ご鏂囦歡鍚嶅氨鏄痠ostream.h銆傛爣鍑咰++寮曞叆浜嗗悕瀛楃┖闂寸殑姒傚康錛屽茍鎶奿ostream絳夋爣鍑嗗簱涓殑涓滀笢灝佽鍒頒簡std鍚嶅瓧絀洪棿涓紝鍚屾椂涓轟簡涓嶄笌鍘熸潵鐨勫ご鏂囦歡娣鋒穯錛岃瀹氭爣鍑咰++浣跨敤涓濂楁柊鐨勫ご鏂囦歡錛岃繖濂楀ご鏂囦歡鐨勬枃浠跺悕鍚庝笉鍔?h鎵╁睍鍚嶏紝濡俰ostream銆乻tring絳夌瓑錛屽茍涓旀妸鍘熸潵C鏍囧噯搴撶殑澶存枃浠朵篃閲嶆柊鍛藉悕錛屽鍘熸潵鐨剆tring.h灝辨敼鎴恈string(灝辨槸鎶?h鍘繪帀錛屽墠闈㈠姞涓婂瓧姣峜)錛屾墍浠ュご鏂囦歡鍖呭惈鐨勫啓娉曚篃灝卞彉鎴愪簡#include <iostream>銆? 騫朵笉鏄啓浜?include<iostream>灝卞繀欏葷敤using namespace std;鎴戜滑閫氬父榪欐牱鐨勫啓鐨勫師鍥犳槸涓轟簡涓涓嬪瓙鎶妔td鍚嶅瓧絀洪棿鐨勪笢涓滃叏閮ㄦ毚闇插埌鍏ㄥ眬鍩熶腑錛堝氨鍍忔槸鐩存帴鍖呭惈浜唅ostream.h榪欑娌℃湁鍚嶅瓧絀洪棿鐨勫ご鏂囦歡涓鏍鳳級錛屼嬌鏍囧噯C++搴撶敤璧鋒潵涓庝紶緇熺殑iostream.h涓鏍鋒柟渚褲傚鏋滀笉鐢╱sing namespace std;浣跨敤鏍囧噯搴撴椂灝卞緱鏃舵椂甯︿笂鍚嶅瓧絀洪棿鐨勫叏鍚嶏紝濡俿td::cout << "hello" << std::endl; #include "iostream"涓?include<iostream>鐨勫尯鍒細鍓嶈呭厛鍦ㄥ綋鍓嶇洰褰曟壘iostream鏂囦歡錛屾壘涓嶅埌鍐嶅幓緋葷粺澶存枃浠惰礬寰勬壘錛屽悗鑰呭弽涔嬨傚洜姝わ紝鍋氫負涓涓壇濂界殑涔犳儻錛屽湪鍖呭惈緋葷粺澶存枃浠舵椂灝介噺鐢?lt;>錛岃屽湪鍖呭惈鑷繁鐨勫伐紼嬩腑鐨勫ご鏂囦歡鏃剁敤""銆?
]]> 青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
久久久久九九视频 |
久久人人精品 |
亚洲人成艺术 |
午夜日韩在线观看 |
一本色道久久88精品综合 |
性色av一区二区怡红 |
亚洲午夜精品久久 |
欧美风情在线观看 |
久久夜色精品亚洲噜噜国产mv |
欧美日韩国产在线一区 |
欧美国产丝袜视频 |
国精品一区二区三区 |
亚洲一区网站 |
亚洲免费在线视频一区 二区 |
欧美精品少妇一区二区三区 |
欧美韩日视频 |
亚洲第一级黄色片 |
久久精品视频va |
久久精品二区 |
国产综合视频 |
欧美在线亚洲在线 |
久久久夜夜夜 |
激情亚洲成人 |
久久先锋影音 |
欧美国产视频在线 |
亚洲精品乱码久久久久久 |
久久综合久色欧美综合狠狠 |
免费日韩成人 |
亚洲日本va午夜在线电影 |
你懂的视频一区二区 |
亚洲国产成人精品久久 |
亚洲高清免费视频 |
美日韩精品免费 |
亚洲第一区色 |
99riav国产精品 |
欧美日韩国产区一 |
亚洲天堂av高清 |
亚洲欧美成人在线 |
国产亚洲成av人在线观看导航 |
欧美一区二区三区免费视频 |
久久精品一区二区三区不卡牛牛
|
在线中文字幕不卡 |
欧美日韩情趣电影 |
中文国产亚洲喷潮 |
久久国产免费 |
在线观看不卡av |
欧美精品乱码久久久久久按摩 |
亚洲免费观看 |
小黄鸭精品aⅴ导航网站入口 |
国产麻豆9l精品三级站 |
欧美中文在线免费 |
欧美激情第4页 |
一区二区三区国产精品 |
国产精品成人免费精品自在线观看 |
亚洲专区在线视频 |
男女视频一区二区 |
亚洲一级黄色片 |
国产一区二区三区电影在线观看 |
久久夜色精品国产噜噜av |
亚洲欧洲日夜超级视频 |
亚洲欧美视频在线 |
亚洲高清免费 |
国产精品国产成人国产三级 |
久久精品国产亚洲精品 |
亚洲国产精品t66y |
欧美一级片久久久久久久 |
在线观看日韩www视频免费
|
国产精品视频精品视频 |
久久久久国产一区二区三区四区 |
亚洲人成绝费网站色www |
欧美淫片网站 |
亚洲乱码精品一二三四区日韩在线 |
国产精品美女久久久久aⅴ国产馆 |
欧美伊人久久久久久午夜久久久久 |
亚洲国产精品一区二区第四页av |
欧美一级免费视频 |
亚洲九九九在线观看 |
国产午夜精品美女视频明星a级 |
欧美插天视频在线播放 |
午夜精品久久久久久久99黑人 |
亚洲国产日日夜夜 |
久久久久成人网 |
亚洲综合欧美 |
亚洲久色影视 |
亚洲国产高清一区二区三区 |
国产农村妇女毛片精品久久麻豆
|
欧美国产日韩xxxxx |
欧美亚洲网站 |
中文亚洲视频在线 |
亚洲精品久久久蜜桃 |
老鸭窝毛片一区二区三区 |
亚洲宅男天堂在线观看无病毒 |
亚洲肉体裸体xxxx137 |
一区二区三区在线看 |
国产噜噜噜噜噜久久久久久久久 |
欧美日本一区 |
欧美福利在线 |
欧美成人免费观看 |
久久久久网址 |
久久久久久久国产 |
欧美中文在线观看 |
欧美一级理论性理论a |
亚洲综合色视频 |
一区二区欧美在线观看 |
日韩一区二区福利 |
日韩亚洲精品电影 |
亚洲精选在线观看 |
亚洲区第一页 |
亚洲理论在线 |
亚洲免费高清 |
一区二区不卡在线视频 午夜欧美不卡在
|
欧美国产亚洲精品久久久8v |
久久色在线播放 |
久久一综合视频 |
美女国内精品自产拍在线播放 |
久久先锋影音 |
免费日韩一区二区 |
欧美激情精品久久久久 |
亚洲激情综合 |
一本色道久久88亚洲综合88 |
一本大道久久a久久精品综合
|
亚洲欧美激情四射在线日 |
亚洲一区二区三区视频 |
亚洲欧美日韩国产一区二区三区 |
亚洲制服av |
久久精品国产精品 |
久热精品在线视频 |
欧美乱大交xxxxx |
欧美午夜精品伦理 |
国产日韩亚洲欧美精品 |
黑人中文字幕一区二区三区 |
在线日韩av永久免费观看 |
最新高清无码专区 |
亚洲一级在线观看 |
欧美在线免费看 |
欧美成人精精品一区二区频 |
欧美激情日韩 |
亚洲视频每日更新 |
久久久久久午夜 |
欧美欧美天天天天操 |
国产精品日韩欧美大师 |
影音先锋国产精品 |
一本到高清视频免费精品 |
性欧美超级视频 |
国产精品白丝黑袜喷水久久久 |
国产精品家教 |
一区精品在线播放 |
一区二区三区欧美日韩 |
久久精品夜色噜噜亚洲a∨
|
亚洲国产日韩精品 |
一本色道久久99精品综合 |
午夜视频在线观看一区 |
欧美阿v一级看视频 |
国产精品日韩久久久 |
亚洲激情综合 |
欧美一区二视频在线免费观看 |
欧美成人黑人xx视频免费观看 |
中文在线资源观看视频网站免费不卡 |
欧美一区在线直播 |
欧美日韩成人综合 |
在线观看亚洲 |
欧美一级电影久久 |
亚洲精品在线电影 |
久久先锋资源 |
国产毛片精品国产一区二区三区 |
91久久久久久久久 |
久久精品国产一区二区电影 |
亚洲乱码精品一二三四区日韩在线 |
欧美一区二区三区四区在线观看 |
欧美日韩国产成人 |
在线日韩一区二区 |
久久福利影视 |
亚洲一区二区三区涩 |
欧美国产亚洲精品久久久8v |
国内精品久久久久影院薰衣草 |
亚洲一区自拍 |
亚洲精品免费在线播放 |
久久先锋资源 |
黄色成人av在线 |
性欧美大战久久久久久久久 |
亚洲日本一区二区三区 |
久久在线免费观看视频 |
国产在线拍偷自揄拍精品 |
亚洲综合色视频 |
日韩一区二区精品在线观看 |
欧美风情在线观看 |
亚洲风情亚aⅴ在线发布 |
久久久久91 |
欧美在线欧美在线 |
国产日韩av在线播放 |
午夜精品三级视频福利 |
一区二区三区国产在线 |
欧美视频你懂的 |
亚洲一区二区三区四区中文 |
亚洲人成亚洲人成在线观看 |
欧美精品一区在线观看 |
日韩一级在线观看 |
亚洲人成人一区二区在线观看 |
欧美国产日韩一区二区 |
亚洲久久视频 |