锘??xml version="1.0" encoding="utf-8" standalone="yes"?>欧美伊人久久大香线蕉综合69,精品久久久久久成人AV,日本五月天婷久久网站http://www.shnenglu.com/snowball/archive/2008/04/02/45994.htmlsnowballsnowballWed, 02 Apr 2008 01:26:00 GMThttp://www.shnenglu.com/snowball/archive/2008/04/02/45994.htmlhttp://www.shnenglu.com/snowball/comments/45994.htmlhttp://www.shnenglu.com/snowball/archive/2008/04/02/45994.html#Feedback0http://www.shnenglu.com/snowball/comments/commentRss/45994.htmlhttp://www.shnenglu.com/snowball/services/trackbacks/45994.html闃呰鍏ㄦ枃

snowball 2008-04-02 09:26 鍙戣〃璇勮
]]>
浠巗tr涓垹闄emove涓惈鏈夌殑瀛楃http://www.shnenglu.com/snowball/archive/2008/04/02/45993.htmlsnowballsnowballWed, 02 Apr 2008 01:25:00 GMThttp://www.shnenglu.com/snowball/archive/2008/04/02/45993.htmlhttp://www.shnenglu.com/snowball/comments/45993.htmlhttp://www.shnenglu.com/snowball/archive/2008/04/02/45993.html#Feedback0http://www.shnenglu.com/snowball/comments/commentRss/45993.htmlhttp://www.shnenglu.com/snowball/services/trackbacks/45993.html /* **************************************** */
/* 聽浠巗tr涓垹闄emove涓惈鏈夌殑瀛楃聽聽聽聽聽聽聽聽聽聽 */
/* **************************************** */
void 聽RemoveChar( char 聽str[],聽 char 聽remove[])
{
聽聽聽聽
int 聽dst,src;
聽聽聽聽
char 聽removeArray[ 256 ];
聽聽聽聽puts(str);
聽聽聽聽puts(remove);
聽聽聽聽
for (src = 0 ;src < 256 ;src ++ )
聽聽聽聽
{
聽聽聽聽聽聽聽removeArray[src]
= 0 ;
聽聽聽聽}

聽聽聽聽src
= 0 ;
聽聽聽聽
while (remove[src])
聽聽聽聽
{
聽聽聽聽聽聽聽removeArray[remove[src
++ ]] = 1 ;
聽聽聽聽}

聽聽聽聽src
= 0 ;dst = 0 ;
聽聽聽聽
while (str[src])
聽聽聽聽
{
聽聽聽聽聽聽聽聽
if ( ! removeArray[str[src]])
聽聽聽聽聽聽聽聽
{
聽聽聽聽聽聽聽聽聽聽聽聽str[dst
++ ] = str[src];
聽聽聽聽聽聽聽聽}

聽聽聽聽聽聽聽聽src
++ ;
聽聽聽聽}

聽聽聽聽str[dst]
= 0 ;
聽聽聽聽puts(str);
}


snowball 2008-04-02 09:25 鍙戣〃璇勮
]]>
Write a routine that prints out a 2-D array in spiral orderhttp://www.shnenglu.com/snowball/archive/2008/04/02/45992.htmlsnowballsnowballWed, 02 Apr 2008 01:23:00 GMThttp://www.shnenglu.com/snowball/archive/2008/04/02/45992.htmlhttp://www.shnenglu.com/snowball/comments/45992.htmlhttp://www.shnenglu.com/snowball/archive/2008/04/02/45992.html#Feedback0http://www.shnenglu.com/snowball/comments/commentRss/45992.htmlhttp://www.shnenglu.com/snowball/services/trackbacks/45992.html 聽聽聽聽 jeccy (鐕曢鏈堝ぉ) 浜?2006騫?0鏈?8鏃?1:37:09 鏄熸湡鍏?鎻愬埌錛?/font>

鎴戠殑鐞嗚В錛岀粰瀹?緇存暟緇?br />1 2 3涓夎褰㈠垽鏂?br />8 9 4
7 6 5
鈥滆灪鏃嬪紡鈥濋『搴忚緭鍑猴細1 2 3 4 5 6 7 8 9
銆?鍦?bluexyz (鏁版嵁緇撴瀯鏄牴鏈? 鐨勫ぇ浣滀腑鎻愬埌: 銆?/font>

private static void 聽PrintNumberasSpiralOrder()
聽聽聽聽聽聽聽聽
{
聽聽聽聽聽聽聽聽聽聽聽聽
// 1聽聽2聽聽3聽聽聽4
聽聽聽聽聽聽聽聽聽聽聽聽
// 12聽13聽14聽聽5
聽聽聽聽聽聽聽聽聽聽聽聽
// 11聽16聽15聽聽6
聽聽聽聽聽聽聽聽聽聽聽聽
// 10聽9聽聽聽8聽聽7
聽聽聽聽聽聽聽聽聽聽聽聽
聽聽聽聽聽聽聽聽聽聽聽聽
// 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
聽聽聽聽聽聽聽聽聽聽聽聽 int [,]聽a聽 = new int [,]
聽聽聽聽聽聽聽聽聽聽聽聽
{聽 {聽 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 聽} 聽}
;
聽聽聽聽聽聽聽聽聽聽聽聽
// int[,]聽a聽=聽new聽int[,]聽{聽{聽1,聽2,聽3,聽4聽},聽{聽12,聽13,聽14,聽5聽},聽{聽11,聽16,聽15,聽6聽},聽{聽10,聽9,聽8,聽7聽}聽};
聽聽聽聽聽聽聽聽聽聽聽聽
// int[,]聽a聽=聽new聽int[,]聽{聽{聽1,聽2聽},聽{4,3}聽};
聽聽聽聽聽聽聽聽聽聽聽聽 const int 聽N聽 = 5 ;
聽聽聽聽聽聽聽聽聽聽聽聽
// 聽spiral
聽聽聽聽聽聽聽聽聽聽聽聽 for 聽( int 聽i聽 = 聽N聽 - 1 ,聽j聽 = 0 ;聽i聽 > 0 ;聽i -- ,聽j ++ )
聽聽聽聽聽聽聽聽聽聽聽聽
{
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
// i聽浠庢渶澶х淮搴︽暟寮濮?br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 // j聽浠庢渶灝忕淮搴︽暟寮濮?br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 // i--鏉ョ緝灝忚寖鍥?br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 // j++鏉ョ緝灝忚寖鍥?br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 // k聽澧為暱緙╁皬鍥犲瓙
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 for 聽( int 聽k聽 = 聽j;聽k聽 < 聽i;聽k ++ )
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽System.Console.Write(
" {0}聽 " ,聽a[j,聽k]);聽Console.WriteLine( "" );
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
for 聽( int 聽k聽 = 聽j;聽k聽 < 聽i;聽k ++ )
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽System.Console.Write(
" {0}聽 " ,聽a[k,聽i]);聽Console.WriteLine( "" );
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
for 聽( int 聽k聽 = 聽i;聽k聽 > 聽j;聽k -- )
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽System.Console.Write(
" {0}聽 " ,聽a[i,聽k]);聽Console.WriteLine( "" );
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
for 聽( int 聽k聽 = 聽i;聽k聽 > 聽j;聽k -- )
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽System.Console.Write(
" {0}聽 " ,聽a[k,聽j]);聽Console.WriteLine( "" );
聽聽聽聽聽聽聽聽聽聽聽聽}

聽聽聽聽聽聽聽聽聽聽聽聽
// 聽special聽case聽for聽middle聽element聽if聽N聽is聽odd
聽聽聽聽聽聽聽聽聽聽聽聽
// 濡傛灉鏄鏁幫紝鍒欒鏉″嵃涓棿鐨勬暟銆?/span>
聽聽聽聽聽聽聽聽聽聽聽聽 if 聽(N聽 % 2 == 1 )聽System.Console.Write(a[(N聽 - 1 )聽 / 2 ,聽(N聽 - 1 )聽 / 2 ]);
聽聽聽聽聽聽聽聽}

Reference : http://bigtiger2005.spaces.live.com/blog/cns!4e967c6fe38e7c14!141.entry?wa=wsignin1.0

snowball 2008-04-02 09:23 鍙戣〃璇勮
]]>
100鎵囬棬錛?00涓漢錛岀i涓漢緇忚繃闂ㄥ彿鍙互鏁撮櫎i鐨勯棬銆傜粡榪囨椂錛屽鏋滈棬寮灝卞叧錛屽鏋滈棬鍏沖氨寮銆傞棶鏈鍚庢墍鏈夐棬鐨勭姸鎬佹槸浠涔堛?/title><link>http://www.shnenglu.com/snowball/archive/2008/04/02/45990.html</link><dc:creator>snowball</dc:creator><author>snowball</author><pubDate>Wed, 02 Apr 2008 01:20:00 GMT</pubDate><guid>http://www.shnenglu.com/snowball/archive/2008/04/02/45990.html</guid><wfw:comment>http://www.shnenglu.com/snowball/comments/45990.html</wfw:comment><comments>http://www.shnenglu.com/snowball/archive/2008/04/02/45990.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/snowball/comments/commentRss/45990.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/snowball/services/trackbacks/45990.html</trackback:ping><description><![CDATA[ <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> <span style="COLOR: #000000">#include聽聽聽</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">stdio.h</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000">聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /></span> <span style="COLOR: #0000ff">#define</span> <span style="COLOR: #000000">聽聽聽N聽聽聽100聽</span> <span style="COLOR: #000000"> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> </span> <span style="COLOR: #0000ff">#define</span> <span style="COLOR: #000000">聽聽聽OPEN聽聽聽1聽</span> <span style="COLOR: #000000"> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> </span> <span style="COLOR: #0000ff">#define</span> <span style="COLOR: #000000">聽聽聽CLOSED聽聽聽0聽</span> <span style="COLOR: #000000"> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> </span> <span style="COLOR: #0000ff">void</span> <span style="COLOR: #000000">聽聽聽switch_door(</span> <span style="COLOR: #0000ff">int</span> <span style="COLOR: #000000">聽聽聽</span> <span style="COLOR: #000000">*</span> <span style="COLOR: #000000">door)聽<br /><img id="Codehighlighter1_118_238_Open_Image" onclick="this.style.display='none'; Codehighlighter1_118_238_Open_Text.style.display='none'; Codehighlighter1_118_238_Closed_Image.style.display='inline'; Codehighlighter1_118_238_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_118_238_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_118_238_Closed_Text.style.display='none'; Codehighlighter1_118_238_Open_Image.style.display='inline'; Codehighlighter1_118_238_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span> <span id="Codehighlighter1_118_238_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.shnenglu.com/images/dot.gif" /> </span> <span id="Codehighlighter1_118_238_Open_Text"> <span style="COLOR: #000000">{聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff">if</span> <span style="COLOR: #000000">(</span> <span style="COLOR: #000000">*</span> <span style="COLOR: #000000">door聽聽聽</span> <span style="COLOR: #000000">==</span> <span style="COLOR: #000000">聽聽聽OPEN)聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span> <span style="COLOR: #000000">*</span> <span style="COLOR: #000000">door聽聽聽</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">聽聽聽CLOSED;聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff">else</span> <span style="COLOR: #000000">聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span> <span style="COLOR: #000000">*</span> <span style="COLOR: #000000">door聽聽聽</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">聽聽聽OPEN;聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span> </span> <span style="COLOR: #000000">聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /></span> <span style="COLOR: #0000ff">int</span> <span style="COLOR: #000000">聽聽聽main(</span> <span style="COLOR: #0000ff">void</span> <span style="COLOR: #000000">)聽<br /><img id="Codehighlighter1_260_918_Open_Image" onclick="this.style.display='none'; Codehighlighter1_260_918_Open_Text.style.display='none'; Codehighlighter1_260_918_Closed_Image.style.display='inline'; Codehighlighter1_260_918_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_260_918_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_260_918_Closed_Text.style.display='none'; Codehighlighter1_260_918_Open_Image.style.display='inline'; Codehighlighter1_260_918_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span> <span id="Codehighlighter1_260_918_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.shnenglu.com/images/dot.gif" /> </span> <span id="Codehighlighter1_260_918_Open_Text"> <span style="COLOR: #000000">{聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff">int</span> <span style="COLOR: #000000">聽聽聽door[N聽聽聽</span> <span style="COLOR: #000000">+</span> <span style="COLOR: #000000">聽聽聽</span> <span style="COLOR: #000000">1</span> <span style="COLOR: #000000">];聽聽聽</span> <span style="COLOR: #008000">//</span> <span style="COLOR: #008000">聽聽聽waste聽聽聽a聽聽聽door聽</span> <span style="COLOR: #008000"> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /> </span> <span style="COLOR: #000000">聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff">int</span> <span style="COLOR: #000000">聽聽聽person;聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff">int</span> <span style="COLOR: #000000">聽聽聽i;聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff">for</span> <span style="COLOR: #000000">(i聽聽聽</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">聽聽聽</span> <span style="COLOR: #000000">1</span> <span style="COLOR: #000000">;聽聽聽i聽聽聽</span> <span style="COLOR: #000000"><=</span> <span style="COLOR: #000000">聽聽聽N;聽聽聽i</span> <span style="COLOR: #000000">++</span> <span style="COLOR: #000000">)聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽door[i]聽聽聽</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">聽聽聽OPEN;聽聽聽</span> <span style="COLOR: #008000">//</span> <span style="COLOR: #008000">聽聽聽all聽聽聽doors聽聽聽are聽聽聽open聽聽聽at聽聽聽first聽</span> <span style="COLOR: #008000"> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /> </span> <span style="COLOR: #000000"> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff">for</span> <span style="COLOR: #000000">(i聽聽聽</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">聽聽聽</span> <span style="COLOR: #000000">1</span> <span style="COLOR: #000000">;聽聽聽i聽聽聽</span> <span style="COLOR: #000000"><=</span> <span style="COLOR: #000000">聽聽聽N;聽聽聽i</span> <span style="COLOR: #000000">++</span> <span style="COLOR: #000000">)聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff">for</span> <span style="COLOR: #000000">(person聽聽聽</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">聽聽聽</span> <span style="COLOR: #000000">1</span> <span style="COLOR: #000000">;聽聽聽person聽聽聽</span> <span style="COLOR: #000000"><=</span> <span style="COLOR: #000000">聽聽聽N;聽聽聽person</span> <span style="COLOR: #000000">++</span> <span style="COLOR: #000000">)聽聽聽</span> <span style="COLOR: #008000">//</span> <span style="COLOR: #008000">聽聽聽person聽聽聽pass聽聽聽through聽聽聽the聽聽聽door聽</span> <span style="COLOR: #008000"> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /> </span> <span style="COLOR: #000000">聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff">if</span> <span style="COLOR: #000000">(i聽聽聽</span> <span style="COLOR: #000000">%</span> <span style="COLOR: #000000">聽聽聽person聽聽聽</span> <span style="COLOR: #000000">==</span> <span style="COLOR: #000000">聽聽聽</span> <span style="COLOR: #000000">0</span> <span style="COLOR: #000000">)聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽switch_door(</span> <span style="COLOR: #000000">&</span> <span style="COLOR: #000000">door[i]);聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff">for</span> <span style="COLOR: #000000">(i聽聽聽</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">聽聽聽</span> <span style="COLOR: #000000">1</span> <span style="COLOR: #000000">;聽聽聽i聽聽聽</span> <span style="COLOR: #000000"><=</span> <span style="COLOR: #000000">聽聽聽N;聽聽聽i</span> <span style="COLOR: #000000">++</span> <span style="COLOR: #000000">)聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽printf(聽</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">door聽聽聽%d:聽聽聽%s\n聽</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">,聽聽聽i,聽聽聽door[i]聽聽聽</span> <span style="COLOR: #000000">?</span> <span style="COLOR: #000000">聽聽聽</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">Open聽</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">聽聽聽:聽聽聽</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">Closed聽</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">);聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000">聽聽聽</span> <span style="COLOR: #000000">0</span> <span style="COLOR: #000000">;聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span> </span> <span style="COLOR: #000000">聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /></span> </div> <font face="Arial" size="2">緇欎竴涓棰樼殑鎬濇兂錛?<br />瑕佺湅闂ㄧ殑鐘舵侊紝涓昏鏄湅榪欐墖闂ㄥ紑鍏蟲鏁幫紝寮鍏沖鏁版浼氫嬌闂ㄧ殑鐘舵佹敼鍙橈紝鑰屽伓鏁版灝變笉浼氥傝屽彧瑕佽兘澶熺煡閬撳綋鍓嶉棬鐨勭紪鍙瘋兘澶熸暣闄ょ殑鑷劧鏁幫紝灝卞彲浠ョ煡閬撻棬鐨勭姸鎬佹槸鍚︽敼鍙樹簡銆備粠鑰岀煡閬撻棬褰撴渶緇堢殑鐘舵併?<br /><br />涓嬮潰鎴戜滑灝嗘墍鏈夌殑鏁板垎涓轟袱緇勶紝騫蟲柟鏁幫紙1錛?錛?鈥︹︼級鍜岄潪騫蟲柟鏁幫紙涓轟粈涔堣榪欎箞鍒嗭紵涓嬮潰灝辯煡閬撲簡錛夈?<br />鐜板湪璁ㄨ闈炲鉤鏂規暟鐨勬儏鍐點傛垜浠亣璁鵑棬鍙蜂負N,鍚屾椂鍋囪浠?寮濮嬪埌int(N^(1/2))(涔熷氨鏄疦鐨勫紑鏂規暟鑸嶅皬鏁板彇鏁達級錛屾誨叡鏈塎涓暟鑳芥暣闄,鍒欎粠int(N^(1/2))+1鍒癗,鎬誨叡鍒欏搴斾篃鏈塎涓暟鑳藉灝哊鏁撮櫎銆傦紙榪欏彞璇濅粩緇嗘兂涓涓嬶級銆?<br />鍦ㄦ錛屽氨鏈?*M涓暟鑳藉皢N鏁撮櫎錛屽畠鏄竴涓伓鏁般傚洜姝ら棬寮鍏充簡鍋舵暟嬈★紝闂ㄧ殑鐘舵佹渶鍚庝笉浼氳鏀瑰彉銆?<br /><br />鐜板湪璁ㄨ騫蟲柟鏁幫紝鍥犱負N^(1/2)榪欎釜鏁版槸涓涓暣鏁幫紝鍥犳鎴戜滑灝嗕粠1鍒癗鐨勬墍鏈夌殑鏁扮敤N^(1/2)榪欎釜鏁板垎鎴愪袱閮ㄥ垎(涓嶅寘鎷琋^(1/2))錛屽悓鏍峰亣璁懼墠鍗婇儴鍒嗘湁M涓暟鍙互灝哊鏁撮櫎錛屽垯鍚庡崐閮ㄥ垎涔熸湁M涓暟鍙互灝哊鏁撮櫎錛岃繖鏍峰氨鏈?*M涓暟鍙互鏁撮櫎N浜嗭紝鍐嶅姞涓奛^(1/2)榪欎釜鏁般傛誨叡灝辨湁2*M+1涓暟鍙互鏁撮櫎N,涔熷氨鏄紪鍙蜂負N鐨勯棬浼氬紑鍏?*M+1嬈★紝闂ㄧ殑鐘舵佸氨浼氳鏀瑰彉浜嗐?<br /><br />緇間笂錛屽鏋滈棬鍙鋒暟鏄鉤鏂規暟鐨勶紝闂ㄧ殑鐘舵佸氨浼氬彂鐢熸敼鍙橈紝鑰屼笉鏄鉤鏂規暟鐨勫氨涓嶄細鏀瑰彉鐘舵佷簡銆傚洜姝わ紝鍙媯鏌ラ棬鏄惁涓哄畬鍏ㄥ鉤鏂規暟灝卞彲浠ュ垽鏂棬鐨勭姸鎬佷負寮榪樻槸涓哄叧浜嗐?/font> <br /> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> <span style="COLOR: #000000">甯栦笂浠g爜錛毬?br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />#include聽聽聽</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">iostream</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000">聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />#include聽聽聽</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">cmath</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000">聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /></span> <span style="COLOR: #0000ff">using</span> <span style="COLOR: #000000">聽聽聽</span> <span style="COLOR: #0000ff">namespace</span> <span style="COLOR: #000000">聽聽聽std;聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /></span> <span style="COLOR: #0000ff">int</span> <span style="COLOR: #000000">聽聽聽main()聽<br /><img id="Codehighlighter1_91_414_Open_Image" onclick="this.style.display='none'; Codehighlighter1_91_414_Open_Text.style.display='none'; Codehighlighter1_91_414_Closed_Image.style.display='inline'; Codehighlighter1_91_414_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_91_414_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_91_414_Closed_Text.style.display='none'; Codehighlighter1_91_414_Open_Image.style.display='inline'; Codehighlighter1_91_414_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span> <span id="Codehighlighter1_91_414_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.shnenglu.com/images/dot.gif" /> </span> <span id="Codehighlighter1_91_414_Open_Text"> <span style="COLOR: #000000">{聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff">int</span> <span style="COLOR: #000000">聽聽聽k;聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff">for</span> <span style="COLOR: #000000">(</span> <span style="COLOR: #0000ff">int</span> <span style="COLOR: #000000">聽聽聽i聽聽聽</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">聽聽聽</span> <span style="COLOR: #000000">1</span> <span style="COLOR: #000000">;聽聽聽i聽聽聽</span> <span style="COLOR: #000000"><=</span> <span style="COLOR: #000000">100</span> <span style="COLOR: #000000">;聽聽聽i</span> <span style="COLOR: #000000">++</span> <span style="COLOR: #000000">)聽<br /><img id="Codehighlighter1_170_398_Open_Image" onclick="this.style.display='none'; Codehighlighter1_170_398_Open_Text.style.display='none'; Codehighlighter1_170_398_Closed_Image.style.display='inline'; Codehighlighter1_170_398_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_170_398_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_170_398_Closed_Text.style.display='none'; Codehighlighter1_170_398_Open_Image.style.display='inline'; Codehighlighter1_170_398_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />聽聽聽聽聽聽聽聽</span> <span id="Codehighlighter1_170_398_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.shnenglu.com/images/dot.gif" /> </span> <span id="Codehighlighter1_170_398_Open_Text"> <span style="COLOR: #000000">{聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽cout聽聽聽</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">聽</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">聽聽聽</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">Door聽聽聽</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">聽聽聽</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">聽</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">聽聽聽i聽聽聽;聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽k聽聽聽</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">聽聽聽</span> <span style="COLOR: #0000ff">int</span> <span style="COLOR: #000000">(sqrt(i));聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff">if</span> <span style="COLOR: #000000">(k</span> <span style="COLOR: #000000">*</span> <span style="COLOR: #000000">k聽聽聽</span> <span style="COLOR: #000000">==</span> <span style="COLOR: #000000">聽聽聽i)聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽cout聽聽聽</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">聽</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">聽聽聽</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">:聽聽聽Closed聽</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">;聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff">else</span> <span style="COLOR: #000000">聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽cout聽聽聽</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">聽</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">聽聽聽</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">:聽聽聽Open聽</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">;聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽cout聽聽聽</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">聽</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">聽聽聽endl;聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽聽聽聽聽聽聽聽}</span> </span> <span style="COLOR: #000000">聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /></span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000">聽聽聽</span> <span style="COLOR: #000000">0</span> <span style="COLOR: #000000">;聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span> </span> <span style="COLOR: #000000">聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />褰撶劧錛岃繖鏄埄鐢ㄤ簡浜烘暟涓庨棬鏁版槸鐩哥瓑鐨勬儏鍐點傚鏋滀釜鏁頒笉鍚岀殑璇濓紝榪樻槸鎸夌収涓妤肩殑鏉ャ?/span> </div> <br />Reference : <a >http://topic.csdn.net/u/20070620/14/3d5e96d5-169a-4bc6-887c-ca8639cd8c63.html</a><img src ="http://www.shnenglu.com/snowball/aggbug/45990.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/snowball/" target="_blank">snowball</a> 2008-04-02 09:20 <a href="http://www.shnenglu.com/snowball/archive/2008/04/02/45990.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>緇熻1鐨勪釜鏁?/title><link>http://www.shnenglu.com/snowball/archive/2008/04/02/45989.html</link><dc:creator>snowball</dc:creator><author>snowball</author><pubDate>Wed, 02 Apr 2008 01:17:00 GMT</pubDate><guid>http://www.shnenglu.com/snowball/archive/2008/04/02/45989.html</guid><wfw:comment>http://www.shnenglu.com/snowball/comments/45989.html</wfw:comment><comments>http://www.shnenglu.com/snowball/archive/2008/04/02/45989.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/snowball/comments/commentRss/45989.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/snowball/services/trackbacks/45989.html</trackback:ping><description><![CDATA[ <p>緇熻1鐨勪釜鏁?/p> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> <span style="COLOR: #0000ff">int</span> <span style="COLOR: #000000">聽func(x)<br /><img id="Codehighlighter1_12_117_Open_Image" onclick="this.style.display='none'; Codehighlighter1_12_117_Open_Text.style.display='none'; Codehighlighter1_12_117_Closed_Image.style.display='inline'; Codehighlighter1_12_117_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_12_117_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_12_117_Closed_Text.style.display='none'; Codehighlighter1_12_117_Open_Image.style.display='inline'; Codehighlighter1_12_117_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span> <span id="Codehighlighter1_12_117_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.shnenglu.com/images/dot.gif" /> </span> <span id="Codehighlighter1_12_117_Open_Text"> <span style="COLOR: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽</span> <span style="COLOR: #0000ff">int</span> <span style="COLOR: #000000">聽countx聽</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">聽</span> <span style="COLOR: #000000">0</span> <span style="COLOR: #000000">;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽</span> <span style="COLOR: #0000ff">while</span> <span style="COLOR: #000000">(x)<br /><img id="Codehighlighter1_51_96_Open_Image" onclick="this.style.display='none'; Codehighlighter1_51_96_Open_Text.style.display='none'; Codehighlighter1_51_96_Closed_Image.style.display='inline'; Codehighlighter1_51_96_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_51_96_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_51_96_Closed_Text.style.display='none'; Codehighlighter1_51_96_Open_Image.style.display='inline'; Codehighlighter1_51_96_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />聽聽聽聽</span> <span id="Codehighlighter1_51_96_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.shnenglu.com/images/dot.gif" /> </span> <span id="Codehighlighter1_51_96_Open_Text"> <span style="COLOR: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽countx</span> <span style="COLOR: #000000">++</span> <span style="COLOR: #000000">;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽x聽</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">聽x</span> <span style="COLOR: #000000">&</span> <span style="COLOR: #000000">(x</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">1</span> <span style="COLOR: #000000">);<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽聽聽聽}</span> </span> <span style="COLOR: #000000"> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽</span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000">聽countx;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span> </span> <span style="COLOR: #000000">聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />鍋囧畾x聽</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">聽</span> <span style="COLOR: #000000">9999</span> <span style="COLOR: #000000"> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> </span> <span style="COLOR: #000000">10011100001111</span> <span style="COLOR: #000000"> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />絳旀:聽</span> <span style="COLOR: #000000">8</span> <span style="COLOR: #000000"> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />灝唜杞寲涓?榪涘埗錛岀湅鍚湁鐨?鐨勪釜鏁?br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />x</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">x</span> <span style="COLOR: #000000">&</span> <span style="COLOR: #000000">(x</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">1</span> <span style="COLOR: #000000">)聽榪欑綆楁硶鏄妸涓涓簩榪涘埗鏁版渶鍙寵竟鐨勪竴涓?鍙樻垚0<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />鐒跺悗鍛紵<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />x</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">1涓巟鍖哄埆鍦ㄤ簬鏈鍚庝簩榪涘埗鐨?<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />姣忔墽琛屼竴嬈聽</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">聽x</span> <span style="COLOR: #000000">&</span> <span style="COLOR: #000000">(x</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">1</span> <span style="COLOR: #000000">)錛屼細灝唜鐢ㄤ簩榪涘埗琛ㄧず鏃舵渶鍙寵竟鐨勪竴涓?鍙樹負0錛屽洜涓簒</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">1灝嗕細灝嗚浣?x鐢ㄤ簩榪涘埗琛ㄧず鏃舵渶鍙寵竟鐨勪竴涓?)鍙樹負0銆?br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />濡傛灉鏄簩榪涘埗100,</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">1</span> <span style="COLOR: #000000">錛屽垯涓?11<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />濡傛灉鏄簩榪涘埗101錛?/span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">1鍒欎負100<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />涓庡師鏁頒竴涓庯紝灝?鍚庨潰鐨勬暟錛屽寘鎷?鍏ㄩ兘涓庢帀<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />鏄庣櫧錛岃阿璋簡聽<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />涓嶅姘?/span> </div> <p> <br />鎬濊礬: 灝唜杞寲涓?榪涘埗錛岀湅鍚湁鐨?鐨勪釜鏁般?br />娉? 姣忔墽琛屼竴嬈 = x&(x-1)錛屼細灝唜鐢ㄤ簩榪涘埗琛ㄧず鏃舵渶鍙寵竟鐨勪竴涓?鍙樹負0錛屽洜涓簒-1灝嗕細灝嗚浣?x鐢ㄤ簩榪涘埗琛ㄧず鏃舵渶鍙寵竟鐨勪竴涓?)鍙樹負0銆?1) 濡傛灉涓涓暟鏄?鐨刵嬈℃柟錛岄偅涔堣繖涓暟鐢ㄤ簩榪涘埗琛ㄧず鏃跺叾鏈楂樹綅涓?錛屽叾浣欎綅涓?銆?br />鍒ゆ柇涓涓暟(x)鏄惁鏄?鐨刵嬈℃柟<br /><br /></p> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> <span style="COLOR: #000000">#include聽</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">stdio.h</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> </span> <span style="COLOR: #0000ff">int</span> <span style="COLOR: #000000">聽func(x)<br /><img id="Codehighlighter1_32_104_Open_Image" onclick="this.style.display='none'; Codehighlighter1_32_104_Open_Text.style.display='none'; Codehighlighter1_32_104_Closed_Image.style.display='inline'; Codehighlighter1_32_104_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_32_104_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_32_104_Closed_Text.style.display='none'; Codehighlighter1_32_104_Open_Image.style.display='inline'; Codehighlighter1_32_104_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span> <span id="Codehighlighter1_32_104_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.shnenglu.com/images/dot.gif" /> </span> <span id="Codehighlighter1_32_104_Open_Text"> <span style="COLOR: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽</span> <span style="COLOR: #0000ff">if</span> <span style="COLOR: #000000">(聽(x</span> <span style="COLOR: #000000">&</span> <span style="COLOR: #000000">(x</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">1</span> <span style="COLOR: #000000">))聽</span> <span style="COLOR: #000000">==</span> <span style="COLOR: #000000">聽</span> <span style="COLOR: #000000">0</span> <span style="COLOR: #000000">聽)<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000">聽</span> <span style="COLOR: #000000">1</span> <span style="COLOR: #000000">;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽</span> <span style="COLOR: #0000ff">else</span> <span style="COLOR: #000000"> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000">聽</span> <span style="COLOR: #000000">0</span> <span style="COLOR: #000000">;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span> </span> <span style="COLOR: #000000"> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> </span> <span style="COLOR: #0000ff">int</span> <span style="COLOR: #000000">聽main()<br /><img id="Codehighlighter1_118_166_Open_Image" onclick="this.style.display='none'; Codehighlighter1_118_166_Open_Text.style.display='none'; Codehighlighter1_118_166_Closed_Image.style.display='inline'; Codehighlighter1_118_166_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_118_166_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_118_166_Closed_Text.style.display='none'; Codehighlighter1_118_166_Open_Image.style.display='inline'; Codehighlighter1_118_166_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span> <span id="Codehighlighter1_118_166_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.shnenglu.com/images/dot.gif" /> </span> <span id="Codehighlighter1_118_166_Open_Text"> <span style="COLOR: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽</span> <span style="COLOR: #0000ff">int</span> <span style="COLOR: #000000">聽x聽</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">聽</span> <span style="COLOR: #000000">8</span> <span style="COLOR: #000000">;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽聽聽聽printf(</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">%d\n</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">,聽func(x));<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />聽}</span> </span> <span style="COLOR: #000000"> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> </span> </div> <img src ="http://www.shnenglu.com/snowball/aggbug/45989.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/snowball/" target="_blank">snowball</a> 2008-04-02 09:17 <a href="http://www.shnenglu.com/snowball/archive/2008/04/02/45989.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鍏ㄦ帓鍒楃殑鐢熸垚綆楁硶http://www.shnenglu.com/snowball/archive/2008/04/02/45987.htmlsnowballsnowballWed, 02 Apr 2008 01:06:00 GMThttp://www.shnenglu.com/snowball/archive/2008/04/02/45987.htmlhttp://www.shnenglu.com/snowball/comments/45987.htmlhttp://www.shnenglu.com/snowball/archive/2008/04/02/45987.html#Feedback0http://www.shnenglu.com/snowball/comments/commentRss/45987.htmlhttp://www.shnenglu.com/snowball/services/trackbacks/45987.html闃呰鍏ㄦ枃

snowball 2008-04-02 09:06 鍙戣〃璇勮
]]>
榪涘埗杞崲紼嬪簭http://www.shnenglu.com/snowball/archive/2008/04/02/45985.htmlsnowballsnowballWed, 02 Apr 2008 01:02:00 GMThttp://www.shnenglu.com/snowball/archive/2008/04/02/45985.htmlhttp://www.shnenglu.com/snowball/comments/45985.htmlhttp://www.shnenglu.com/snowball/archive/2008/04/02/45985.html#Feedback0http://www.shnenglu.com/snowball/comments/commentRss/45985.htmlhttp://www.shnenglu.com/snowball/services/trackbacks/45985.html void 聽test10_2( void )
聽聽
{
聽聽聽
static char const * 聽szHexDigits聽 = " 01 " ;
聽聽聽unsigned聽
char 聽b聽 = 16 ;
聽聽聽cout聽
<< 聽szHexDigits[(b聽 >> 7 )聽 & 0x01 ]聽 << 聽szHexDigits[(b聽 >> 6 )聽 & 0x01 ]聽 << ' ' ;
聽聽聽cout聽
<< 聽szHexDigits[(b聽 >> 5 )聽 & 0x01 ]聽 << 聽szHexDigits[(b聽 >> 4 )聽 & 0x01 ]聽 << ' ' ;
聽聽聽cout聽
<< 聽szHexDigits[(b聽 >> 3 )聽 & 0x01 ]聽 << 聽szHexDigits[(b聽 >> 2 )聽 & 0x01 ]聽 << ' ' ;
聽聽聽cout聽
<< 聽szHexDigits[(b聽 >> 1 )聽 & 0x01 ]聽 << 聽szHexDigits[(b聽 >> 0 )聽 & 0x01 ]聽 << ' ' ;
聽}
void 聽test10_16( void )
聽聽
{
聽聽聽聽
static char const * 聽szHexDigits聽 = " 0123456789abcdef " ;聽聽聽
聽聽聽unsigned聽
char 聽b聽 = 16 ;
聽聽聽cout聽
<< 聽szHexDigits[(b聽 >> 4 )聽 & 0x0f ]聽 << 聽szHexDigits[b聽 & 0x0f ]聽 << ' ' ;
聽}



snowball 2008-04-02 09:02 鍙戣〃璇勮
]]>
久久久久高潮综合影院| 草草久久久无码国产专区| 精品国产91久久久久久久a| 久久精品人人做人人爽电影蜜月 | 色综合久久综合中文综合网| 亚洲国产成人久久精品99 | 国产精品一久久香蕉国产线看观看 | 久久99国产综合精品免费| www亚洲欲色成人久久精品| 久久精品无码一区二区无码| 久久精品国产亚洲av麻豆色欲 | 亚洲精品乱码久久久久久自慰| 久久久久亚洲AV成人网人人软件| 日韩精品国产自在久久现线拍| 99久久免费国产精品热| 精品久久久久久国产牛牛app| 久久国产精品久久国产精品| 蜜臀久久99精品久久久久久| 色综合久久天天综合| 激情久久久久久久久久| 久久精品国产日本波多野结衣| 国产综合久久久久久鬼色| 国产精品成人久久久久久久| 伊人情人综合成人久久网小说| 久久久久人妻一区精品性色av| 91久久精品电影| 亚洲va中文字幕无码久久| 一本大道久久a久久精品综合| 久久久国产视频| 91久久精品国产成人久久| 精品久久亚洲中文无码| 欧美久久精品一级c片片| 亚洲中文久久精品无码| 久久天天躁狠狠躁夜夜2020老熟妇| 亚洲国产一成人久久精品| 久久免费99精品国产自在现线 | 久久久久99精品成人片| 99久久免费国产精精品| 久久狠狠高潮亚洲精品| 日本五月天婷久久网站| 国产亚洲美女精品久久久|