锘??xml version="1.0" encoding="utf-8" standalone="yes"?>天天躁日日躁狠狠久久,一极黄色视频久久网站,99久久99这里只有免费费精品 http://www.shnenglu.com/qywyh/category/332.html璞?>blog zh-cn Fri, 25 Jul 2008 04:37:35 GMT Fri, 25 Jul 2008 04:37:35 GMT 60 鐪熸槸姘?灞呯劧鍙互榪欐牱灝唅nt杞垚str http://www.shnenglu.com/qywyh/archive/2008/07/25/57122.html璞?/dc:creator>璞?/author>Fri, 25 Jul 2008 03:34:00 GMT http://www.shnenglu.com/qywyh/archive/2008/07/25/57122.html http://www.shnenglu.com/qywyh/comments/57122.html http://www.shnenglu.com/qywyh/archive/2008/07/25/57122.html#Feedback 0 http://www.shnenglu.com/qywyh/comments/commentRss/57122.html http://www.shnenglu.com/qywyh/services/trackbacks/57122.html int num=24; sprintf( result, "%d", num );
]]> 鍐呭瓨姹?version1.1) http://www.shnenglu.com/qywyh/archive/2008/04/21/47737.html璞?/dc:creator>璞?/author>Mon, 21 Apr 2008 08:15:00 GMT http://www.shnenglu.com/qywyh/archive/2008/04/21/47737.html http://www.shnenglu.com/qywyh/comments/47737.html http://www.shnenglu.com/qywyh/archive/2008/04/21/47737.html#Feedback 3 http://www.shnenglu.com/qywyh/comments/commentRss/47737.html http://www.shnenglu.com/qywyh/services/trackbacks/47737.html 闃呰鍏ㄦ枃 ]]> 鏅鴻兘鎸囬拡婧愮爜 http://www.shnenglu.com/qywyh/archive/2008/04/17/47408.html璞?/dc:creator>璞?/author>Thu, 17 Apr 2008 09:01:00 GMT http://www.shnenglu.com/qywyh/archive/2008/04/17/47408.html http://www.shnenglu.com/qywyh/comments/47408.html http://www.shnenglu.com/qywyh/archive/2008/04/17/47408.html#Feedback 3 http://www.shnenglu.com/qywyh/comments/commentRss/47408.html http://www.shnenglu.com/qywyh/services/trackbacks/47408.html
#ifndef AUTOPTR #define AUTOPTR /**/ /* * * 鏅鴻兘鎸囬拡綾?br> */ template< class T > class AutoPtr { public : AutoPtr(T * p = 0 ) : pointee(p) {} // 榛樿鏋勯犲嚱鏁?/span> template< class U > AutoPtr(AutoPtr< U >& rhs) : pointee(rhs.release()) {} // 澶嶅埗鏋勯犲嚱鏁?/span> ~ AutoPtr() {delete pointee;} template< class U > AutoPtr< T >& operator = (AutoPtr < U >& rhs) { // 璧嬪煎嚱鏁?/span> if ( this != & rhs) { reset(rhs.release()); } return * this ; } T& operator * () const { return * pointee;} T * operator -> () const { return pointee;} T* get () const { return pointee;} // 鑾峰彇dumb pointer T* release() { // 閲婃斁dumb pointer 鐨勬嫢鏈夋潈錛屽茍榪斿洖鍏跺?/span> T * oldPointee == pointee; pointee = 0 ; return oldPointee; } void reset(T * p = 0 ) { // 閲嶅緗畃鎸囬拡 if (pointee != p) { delete pointee; pointee = p; } }private : T * pointee; } ; #endif AUTOPTR
test.cpp
#include " AutoPtr.h " #include < iostream > #include < string > using namespace std; int main() { AutoPtr < int > p = new int ; * p = 100 ; printf( " %d\n " , * p); AutoPtr < string > sp = new string ; * sp = " hello world " ; printf( " %s\n " , sp -> c_str()); return 0 ; }
]]> More Effective 鐨?Reference Counting http://www.shnenglu.com/qywyh/archive/2008/04/09/46699.html璞?/dc:creator>璞?/author>Wed, 09 Apr 2008 13:36:00 GMT http://www.shnenglu.com/qywyh/archive/2008/04/09/46699.html http://www.shnenglu.com/qywyh/comments/46699.html http://www.shnenglu.com/qywyh/archive/2008/04/09/46699.html#Feedback 0 http://www.shnenglu.com/qywyh/comments/commentRss/46699.html http://www.shnenglu.com/qywyh/services/trackbacks/46699.html 闃呰鍏ㄦ枃 ]]> 浠庝簩鍙夋爲鐨勯掑綊閬嶅巻鎯沖埌鐨?鍒╃敤閲嶈澆鍑芥暟,浣垮嚱鏁版帴鍙f洿"鍙嬪ソ" http://www.shnenglu.com/qywyh/archive/2006/03/14/4132.html璞?/dc:creator>璞?/author>Tue, 14 Mar 2006 05:11:00 GMT http://www.shnenglu.com/qywyh/archive/2006/03/14/4132.html http://www.shnenglu.com/qywyh/comments/4132.html http://www.shnenglu.com/qywyh/archive/2006/03/14/4132.html#Feedback 9 http://www.shnenglu.com/qywyh/comments/commentRss/4132.html http://www.shnenglu.com/qywyh/services/trackbacks/4132.html 闂鍒嗘瀽: 鍋囪涓涓?BR>struct TreeNode { int tData; TreeNode *lp, *rp;//宸﹀彸鍎垮瓙鐨勬寚閽?BR>};
瑙勫畾鐢ㄩ掑綊鍓嶅簭閬嶅巻浠Node涓烘牴浜屽弶鏍?鎶婅妭鐐規(guī)寚閽堜繚瀛樺湪rs鏁扮粍涓?騫惰繑鍥炶妭鐐逛釜鏁癱nt.
鍥犱負瑕佺敤閫掑綊閬嶅巻, 鎵浠nt蹇呴』淇濈暀閫掑綊姣忓眰cnt鐨勫? 瀹炵幇鏂規(guī)硶鏈変袱縐? 1:鐢╞y value浼犲?cnt鍒濆間負0;
int travel(TreeNode *pNode, TreeNode **rs, int &cnt) { if (pNode == NULL) { return cnt; } rs[cnt++] = pNode; travel(pNode->lp, rs, cnt); travel(pNode->rp, rs, cnt); return cnt; }
2:鐢ㄩ潤鎬佸彉閲忓疄鐜?BR>int travel(TreeNode *pNode, TreeNode **rs) { static int cnt = 0; if (pNode == NULL) { return cnt; } rs[cnt++] = pNode; travel(pNode->lp, rs, cnt); travel(pNode->rp, rs, cnt); return cnt; }
瀵規(guī)瘮1鍜?,鏄劇劧2鐨勫嚱鏁拌姣?鐨勬潵寰楀弸濂?鍥犱負鍦?涓鍔犵殑鍙傛暟cnt涓嶅睘浜庡嚱鏁版帴鍙?鍙槸涓轟簡鍑芥暟鐨勫疄鐜拌屽紩鍏ョ殑,鎵浠ュ弬鏁癱nt鐨勫嚭鐜?鐮村潖浜嗘帴鍙g殑鍙嬪ソ鎬?浣嗘槸濡傛灉鐢?鐨勬柟娉?鍦ㄥ嚱鏁板啀嬈′嬌鐢ㄧ殑鏃跺檚tatic int cnt鐨勫間粛淇濇寔涓婃鍑芥暟琚皟鐢ㄦ椂鐨勫?鑰屾病鏈夊垵濮嬪寲涓?,浠庤岃揪涓嶅埌鍑芥暟鍐嶆琚皟鐢ㄧ殑鐩殑.閭f湁娌℃湁濂界殑瑙e喅鏂規(guī)硶鍛?
鎴戜滑鍒╃敤鍑芥暟閲嶈澆,閲嶈澆travel鍑芥暟,騫跺湪姝ゅ嚱鏁板唴璋冪敤1鐨則ravel鍑芥暟.
int travel(TreeNode *pNode, TreeNode **rs) { int cnt = 0; return travel(TreeNode *pNode, TreeNode **rs, int &cnt); }
榪欐牱鐨勮瘽,灝辮兘寰堝ソ鐨勮В鍐充簡鍑芥暟鎺ュ彛鐨勫弸濂芥?鑰屽張涓嶄細鍑虹幇static鍙橀噺鐨勫壇浣滅敤浜?
浠ヤ笂鏄皬寮熺殑涓鐐規(guī)剼瑙?
]]>鍙堟槸涓棰樺姩鎬佽鍒?-緇忓吀 http://www.shnenglu.com/qywyh/archive/2006/03/01/3616.html璞?/dc:creator>璞?/author>Wed, 01 Mar 2006 13:50:00 GMT http://www.shnenglu.com/qywyh/archive/2006/03/01/3616.html http://www.shnenglu.com/qywyh/comments/3616.html http://www.shnenglu.com/qywyh/archive/2006/03/01/3616.html#Feedback 3 http://www.shnenglu.com/qywyh/comments/commentRss/3616.html http://www.shnenglu.com/qywyh/services/trackbacks/3616.html 婊戦洩 Time Limit:1000MS Memory Limit:65536K
Description Michael鍠滄婊戦洩鐧捐繖騫朵笉濂囨紝 鍥犱負婊戦洩鐨勭‘寰堝埡嬋銆傚彲鏄負浜嗚幏寰楅熷害錛屾粦鐨勫尯鍩熷繀欏誨悜涓嬪炬枩錛岃屼笖褰撲綘婊戝埌鍧″簳錛屼綘涓嶅緱涓嶅啀嬈¤蛋涓婂潯鎴栬呯瓑寰呭崌闄嶆満鏉ヨ澆浣犮侻ichael鎯崇煡閬撹澆涓涓尯鍩熶腑鏈闀垮簳婊戝潯銆傚尯鍩熺敱涓涓簩緇存暟緇勭粰鍑恒傛暟緇勭殑姣忎釜鏁板瓧浠h〃鐐圭殑楂樺害銆備笅闈㈡槸涓涓緥瀛? 1 2 3 4 5
16 17 18 19 6
15 24 25 20 7
14 23 22 21 8
13 12 11 10 9 涓涓漢鍙互浠庢煇涓偣婊戝悜涓婁笅宸﹀彸鐩擱偦鍥涗釜鐐逛箣涓錛屽綋涓斾粎褰撻珮搴﹀噺灝忋傚湪涓婇潰鐨勪緥瀛愪腑錛屼竴鏉″彲婊戣鐨勬粦鍧′負24-17-16-1銆傚綋鐒?5-24-23-...-3-2-1鏇撮暱銆備簨瀹炰笂錛岃繖鏄渶闀跨殑涓鏉°?/FONT>
Input 杈撳叆鐨勭涓琛岃〃紺哄尯鍩熺殑琛屾暟R鍜屽垪鏁癈(1 <= R,C <= 100)銆備笅闈㈡槸R琛岋紝姣忚鏈塁涓暣鏁幫紝浠h〃楂樺害h錛?<=h<=10000銆?/FONT>
Output 杈撳嚭鏈闀垮尯鍩熺殑闀垮害銆?BR> 鎴戞彁浜ょ殑紼嬪簭錛?BR>
#include < iostream > using namespace std; const int MAX = 102 ; struct pos { int i,j,p; // i->琛?j->鍒楋紱p->鏉ユ簮鏂瑰悜 }; int path( int [MAX][MAX], int [MAX][MAX], int [][MAX], int , int ); int main() { int input[MAX][MAX]; int result[MAX][MAX]; int status[MAX][MAX]; int m,n; int i,j; int max,ans; cin >> m >> n; for (i = 0 ; i <= m + 1 ; i ++ ) for (j = 0 ; j <= n + 1 ; j ++ ) { input[i][j] = 10001 ; result[i][j] = 0 ; status[i][j] = 0 ; } for (i = 1 ; i <= m; i ++ ) for (j = 1 ; j <= n; j ++ ) { cin >> input[i][j]; } for (i = 1 ; i <= m; i ++ ) for (j = 1 ; j <= n; j ++ ) path(input,result,status,i,j); max = 0 ; for (i = 1 ; i <= m; i ++ ) for (j = 1 ; j <= n; j ++ ) if (max < result[i][j]) max = result[i][j]; cout << max << endl; return 0 ; } int path( int input[MAX][MAX], int result[MAX][MAX], int status[MAX][MAX], int i, int j) { pos pack[MAX * MAX]; int max,g,h; int ii; int top = 0 ; int p = 0 ; int incr[ 4 ][ 2 ] = {{ - 1 , 0 },{ 0 , 1 },{ 1 , 0 },{ 0 , - 1 }}; // 澧為噺琛?BR> // 鍒濆鍖?/SPAN> if (result[i][j] > 0 ) { return 0 ; } else { pack[top].i = i; pack[top].j = j; pack[top].p = p; status[i][j] = - 1 ; } while (top >= 0 || p < 4 ) { if (p < 4 ) { g = pack[top].i + incr[p][ 0 ]; h = pack[top].j + incr[p][ 1 ]; // 鍒ゆ柇鏄惁鍚堟硶 if (input[pack[top].i][pack[top].j] > input[g][h]) { if (result[g][h] > 0 || status[g][h] ==- 1 ) // p ++ ; else { // 榪涙爤 top ++ ; pack[top].i = g; pack[top].j = h; pack[top].p = p; status[g][h] = - 1 ; p = 0 ; } } // 鍚堟硶 else { p++ ; } } else // p==4鏃?/SPAN> { max = 0 ; for (ii = 0 ; ii < 4 ; ii ++ ) // 鍥涗釜鏂瑰悜 { g = pack[top].i + incr[ii][ 0 ]; h = pack[top].j + incr[ii][ 1 ]; if (input[pack[top].i][pack[top].j] > input[g][h] && max < result[g][h]) max = result[g][h]; } result[pack[top].i][pack[top].j] = max + 1 ; top -- ; // 鍥炴函 p = pack[top].p + 1 ; } } return 0 ; }
姝ら鐢ㄥ埌浜嗗洖婧紝鍜屽姩鎬佽鍒掞紝涔熸槸緇忓吀錛屾帹鑽恆cmer鍋氬仛.嬈㈣繋浜ゆ祦:)
]]> 鐪?c++primer 鍚庣殑涓涓棶棰?/title> http://www.shnenglu.com/qywyh/archive/2005/12/30/2255.html璞?/dc:creator>璞?/author>Thu, 29 Dec 2005 16:21:00 GMT http://www.shnenglu.com/qywyh/archive/2005/12/30/2255.html http://www.shnenglu.com/qywyh/comments/2255.html http://www.shnenglu.com/qywyh/archive/2005/12/30/2255.html#Feedback 13 http://www.shnenglu.com/qywyh/comments/commentRss/2255.html http://www.shnenglu.com/qywyh/services/trackbacks/2255.html (...) 濡?void foo(...); void foo(parm_list,...); void foo(...) { //... } 璋冪敤:foo(a,b,c); 灝辨槸涓嶆噦,鎶奱,b,c鐨勫間紶榪涘嚱鏁伴噷闈㈠悗,鐢ㄤ粈涔堝彉閲忔潵鎺ユ敹???濡傛灉涓嶈兘鎺ユ敹,(...)宀備笉鏄病鎰忎箟? 榪樻湁灝辨槸涓嶆槑鐧?BR>int printf(const char*...); printf("hello,&s\n",userName); 榪欎釜c鐨勮緭鍑哄嚱鏁版槸鎬庝箞鐢?...)瀹炵幇鐨? 鍏堣阿浜?) ]]> 閫掑綊--->璁$畻鏃ユ湡鎬繪暟 http://www.shnenglu.com/qywyh/archive/2005/12/28/2222.html璞?/dc:creator>璞?/author>Wed, 28 Dec 2005 15:12:00 GMT http://www.shnenglu.com/qywyh/archive/2005/12/28/2222.html http://www.shnenglu.com/qywyh/comments/2222.html http://www.shnenglu.com/qywyh/archive/2005/12/28/2222.html#Feedback 6 http://www.shnenglu.com/qywyh/comments/commentRss/2222.html http://www.shnenglu.com/qywyh/services/trackbacks/2222.html 鐭ラ亾鍐欑殑寰堢儌,鍙戜笂鏉ユ椂甯屾湜鍚勪綅鍏勫彴鎸囩偣涓嶈凍:)
鍏堣阿鍟?鍛靛懙.
#include < iostream > using namespace std; struct date { unsigned int year,month,day; } ; unsigned int sum(unsigned int ,unsigned int ,unsigned int ); bool is_eyear(unsigned int ); void main() { date temp; unsigned int total; cout << " please input date,formation:2005 12 05 " << endl; cin >> temp.year >> temp.month >> temp.day; total = sum(temp.year,temp.month,temp.day); cout << " total day= " << total << endl; } unsigned int sum(unsigned int y,unsigned int m,unsigned int d) { unsigned int t = 0 ; if (m < 1 ) { t = 0 ; return t; } else if (m == 1 ) { t = d; return t; } else { switch (m) { case 3 : if (is_eyear(y)) t = d + sum(y,m - 1 , 29 ); else t = d + sum(y,m - 1 , 28 ); break ; case 2 : case 4 : case 6 : case 8 : case 9 : case 11 : t = d + sum(y,m - 1 , 31 ); break ; default : t = d + sum(y,m - 1 , 30 ); break ; } } return t; } // 璁$畻鏃ユ湡鎬繪暟鍑芥暟 /**/ /* ************** bool is_eyear(unsigned int y) { if(y%400==0) return 1; else if(y%4==0) return 1; else return 0; }//鍒ゆ柇闂板勾鍑芥暟 ************* */ bool is_eyear(unsigned int y) { if (y % 100 == 0 && y % 400 == 0 ) return 1 ; if (y % 100 != 0 && y % 4 == 0 ) return 1 ; return 0 ; } // 鍒ゆ柇闂板勾鍑芥暟 ]]> 涓嶇湅涔︽庝箞瑙佸僵铏癸紵 http://www.shnenglu.com/qywyh/archive/2005/11/27/1347.html璞?/dc:creator>璞?/author>Sun, 27 Nov 2005 15:12:00 GMT http://www.shnenglu.com/qywyh/archive/2005/11/27/1347.html http://www.shnenglu.com/qywyh/comments/1347.html http://www.shnenglu.com/qywyh/archive/2005/11/27/1347.html#Feedback 2 http://www.shnenglu.com/qywyh/comments/commentRss/1347.html http://www.shnenglu.com/qywyh/services/trackbacks/1347.html ]]> 鍙橀噺鍒濆鍖栫殑閲嶈鎬? http://www.shnenglu.com/qywyh/archive/2005/11/22/1228.html璞?/dc:creator>璞?/author>Mon, 21 Nov 2005 16:40:00 GMT http://www.shnenglu.com/qywyh/archive/2005/11/22/1228.html http://www.shnenglu.com/qywyh/comments/1228.html http://www.shnenglu.com/qywyh/archive/2005/11/22/1228.html#Feedback 9 http://www.shnenglu.com/qywyh/comments/commentRss/1228.html http://www.shnenglu.com/qywyh/services/trackbacks/1228.html 浠婂ぉ鍦ㄥ仛涓閬撳崕涓洪潰璇曢鐩椂鍊欙紝灝辨槸鍥犱負娌℃湁灝嗗彉閲忓垵濮嬪寲錛岃屽鑷存垜鐢ㄤ簡涓鑺傝鐨勬椂闂磋皟璇曪細錛?BR> 棰樼洰鏄?鎵懼嚭01瀛楃涓蹭腑0鍜?鍑虹幇鐨勬渶澶ф鏁? 浠g爜錛?/P>
#include < iostream > #include< string > using namespace std; void main() { char * a = " 010000010111101101000000000 " ; int i,temp0 = 0 ,temp1 = 0 ,max0 = 0 ,max1 = 0 ; // 瀵瑰彉閲忓垵濮嬪寲錛屽鏋滀笉鍒濆鍖栵紝鍙橀噺鍊兼槸闅忔満鐨?/SPAN> for (i = 0 ;i < strlen(a);i ++ ) { switch (a[i]) { case ' 0 ' : { temp0 ++ ; if (a[i + 1 ] == ' 1 ' || i == strlen(a) - 1 ) { if (max0 < temp0) max0 = temp0; temp0 = 0 ; } break ; } case ' 1 ' : { temp1 ++ ; if (a[i + 1 ] == ' 0 ' || i == strlen(a) - 1 ) { if (max1 < temp1) max1 = temp1; temp1 = 0 ; } break ; } } } cout<< " max0= " << max0 << endl; cout << " max1= " << max1 << endl; } 閭d負浠涔堜笉瀵筰鍒濆鍖栧憿錛熷洜涓哄敖綆娌¤鍒濆鍖栵紝瀹冪殑鍒濆鍊兼槸闅忔満鐨勶紝浣嗗湪寰幆鍙傛暟琛ㄩ噷闈㈠凡緇忓浠栬繘琛岃祴鍊鹼紝鎵浠鐨勯殢鏈哄煎凡緇忚0瑕嗙洊銆?BR> ]]> c++涔嬫ⅵ http://www.shnenglu.com/qywyh/archive/2005/11/13/1110.html璞?/dc:creator>璞?/author>Sun, 13 Nov 2005 03:08:00 GMT http://www.shnenglu.com/qywyh/archive/2005/11/13/1110.html http://www.shnenglu.com/qywyh/comments/1110.html http://www.shnenglu.com/qywyh/archive/2005/11/13/1110.html#Feedback 0 http://www.shnenglu.com/qywyh/comments/commentRss/1110.html http://www.shnenglu.com/qywyh/services/trackbacks/1110.html 濂嬫枟c++,褰撲綘閫夋嫨瀹冪殑鏃跺?鍒啀榪瘋尗,鐩鎬俊瀹?涓瀹氫細甯︾粰浣犳垚鍔?!!! ]]>
日韩AV毛片精品久久久 |
精品国际久久久久999波多野 |
欧美久久综合九色综合 |
无码国内精品久久人妻 |
精品久久久久一区二区三区
|
亚洲v国产v天堂a无码久久 |
久久99久国产麻精品66 |
久久综合九色综合精品 |
2021国产精品久久精品 |
久久香蕉国产线看观看99 |
亚洲精品久久久www |
狠狠色婷婷综合天天久久丁香
|
精品久久久无码中文字幕 |
亚洲AV无码久久精品成人 |
久久精品女人天堂AV麻 |
久久精品国产精品青草 |
国产精品久久久久久久人人看 |
国产精品美女久久久网AV |
69国产成人综合久久精品 |
久久99精品久久久大学生 |
婷婷久久综合九色综合九七 |
久久97久久97精品免视看 |
青青青青久久精品国产h |
www久久久天天com |
久久人人爽人人爽人人爽 |
天天影视色香欲综合久久 |
久久精品国产一区二区
|
久久婷婷色综合一区二区 |
久久播电影网 |
久久久久99精品成人片 |
国内精品久久久久久久影视麻豆
|
久久久久一本毛久久久 |
久久国产香蕉视频 |
久久久久国产成人精品亚洲午夜 |
久久99精品久久久久久9蜜桃 |
91精品国产91久久 |
久久香蕉国产线看观看99 |
精品久久香蕉国产线看观看亚洲 |
国产精品久久久久… |
久久精品视频网 |
精品国产一区二区三区久久蜜臀 |