??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲一区二区三区四区视频,亚洲国产一区二区视频,国产精品久久久久一区二区三区共http://www.aygfsteel.com/zhou-zhihao/天道酬勤Q思者常斎ͼ博观U取Q厚U薄发;?j)如止水Q气贯长虹;淡泊明志Q宁?rn)致q?/description>zh-cnWed, 18 Jun 2025 04:41:14 GMTWed, 18 Jun 2025 04:41:14 GMT60重要http://www.aygfsteel.com/zhou-zhihao/archive/2010/11/24/338958.htmlClumsyBirdClumsyBirdWed, 24 Nov 2010 09:56:00 GMThttp://www.aygfsteel.com/zhou-zhihao/archive/2010/11/24/338958.htmlhttp://www.aygfsteel.com/zhou-zhihao/comments/338958.htmlhttp://www.aygfsteel.com/zhou-zhihao/archive/2010/11/24/338958.html#Feedback0http://www.aygfsteel.com/zhou-zhihao/comments/commentRss/338958.htmlhttp://www.aygfsteel.com/zhou-zhihao/services/trackbacks/338958.htmlhttp://clumsybird.javaeye.com

ClumsyBird 2010-11-24 17:56 发表评论
]]>
问题11Q求l出20*20数组的Q何方向四个数怹的最大?/title><link>http://www.aygfsteel.com/zhou-zhihao/archive/2010/11/24/338936.html</link><dc:creator>ClumsyBird</dc:creator><author>ClumsyBird</author><pubDate>Wed, 24 Nov 2010 08:03:00 GMT</pubDate><guid>http://www.aygfsteel.com/zhou-zhihao/archive/2010/11/24/338936.html</guid><wfw:comment>http://www.aygfsteel.com/zhou-zhihao/comments/338936.html</wfw:comment><comments>http://www.aygfsteel.com/zhou-zhihao/archive/2010/11/24/338936.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/zhou-zhihao/comments/commentRss/338936.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/zhou-zhihao/services/trackbacks/338936.html</trackback:ping><description><![CDATA[     摘要: 问题描述如下Q?    “一?0*20的数l如下所C?         08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08      ...  <a href='http://www.aygfsteel.com/zhou-zhihao/archive/2010/11/24/338936.html'>阅读全文</a><img src ="http://www.aygfsteel.com/zhou-zhihao/aggbug/338936.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/zhou-zhihao/" target="_blank">ClumsyBird</a> 2010-11-24 16:03 <a href="http://www.aygfsteel.com/zhou-zhihao/archive/2010/11/24/338936.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>问题10Q求于2000000的质C?/title><link>http://www.aygfsteel.com/zhou-zhihao/archive/2010/11/23/338831.html</link><dc:creator>ClumsyBird</dc:creator><author>ClumsyBird</author><pubDate>Tue, 23 Nov 2010 09:22:00 GMT</pubDate><guid>http://www.aygfsteel.com/zhou-zhihao/archive/2010/11/23/338831.html</guid><wfw:comment>http://www.aygfsteel.com/zhou-zhihao/comments/338831.html</wfw:comment><comments>http://www.aygfsteel.com/zhou-zhihao/archive/2010/11/23/338831.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/zhou-zhihao/comments/commentRss/338831.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/zhou-zhihao/services/trackbacks/338831.html</trackback:ping><description><![CDATA[    问题描述如下Q?br />         “10以下的质C和ؓ(f)2+3+5+7Q?7Q求2000000以下的质C和?”<br /> <br />     此问题相Ҏ(gu)较简单,在前面的问题?sh)已l给?gu)数判断的?gu)Q具体代码如下:(x)<br /> <div style="padding-right: 5px; padding-left: 4px; font-size: 13px; border-left-color: #cccccc; padding-bottom: 4px; width: 98%; word-break: break-all; padding-top: 4px; background-color: #eeeeee"><img id="Codehighlighter1_0_49_Open_Image" onclick="this.style.display='none'; Codehighlighter1_0_49_Open_Text.style.display='none'; Codehighlighter1_0_49_Closed_Image.style.display='inline'; Codehighlighter1_0_49_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_0_49_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_0_49_Closed_Text.style.display='none'; Codehighlighter1_0_49_Open_Image.style.display='inline'; Codehighlighter1_0_49_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /><span id="Codehighlighter1_0_49_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">/** */</span><span id="Codehighlighter1_0_49_Open_Text"><span style="color: #008000">/**</span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />     * 判断是否是素?br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />     * <br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />     * </span><span style="color: #808080">@param</span><span style="color: #008000"> n<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />     * </span><span style="color: #808080">@return</span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />     </span><span style="color: #008000">*/</span></span><span style="color: #000000"><br /> <img id="Codehighlighter1_95_262_Open_Image" onclick="this.style.display='none'; Codehighlighter1_95_262_Open_Text.style.display='none'; Codehighlighter1_95_262_Closed_Image.style.display='inline'; Codehighlighter1_95_262_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_95_262_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_95_262_Closed_Text.style.display='none'; Codehighlighter1_95_262_Open_Image.style.display='inline'; Codehighlighter1_95_262_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">boolean</span><span style="color: #000000"> isPrimeNumber(</span><span style="color: #0000ff">int</span><span style="color: #000000"> n) </span><span id="Codehighlighter1_95_262_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 alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_95_262_Open_Text"><span style="color: #000000">{<br /> <img id="Codehighlighter1_110_131_Open_Image" onclick="this.style.display='none'; Codehighlighter1_110_131_Open_Text.style.display='none'; Codehighlighter1_110_131_Closed_Image.style.display='inline'; Codehighlighter1_110_131_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_110_131_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_110_131_Closed_Text.style.display='none'; Codehighlighter1_110_131_Open_Image.style.display='inline'; Codehighlighter1_110_131_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />        </span><span style="color: #0000ff">if</span><span style="color: #000000"> (n </span><span style="color: #000000"><</span><span style="color: #000000"> </span><span style="color: #000000">2</span><span style="color: #000000">) </span><span id="Codehighlighter1_110_131_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 alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_110_131_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #0000ff">false</span><span style="color: #000000">;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span></span><span style="color: #000000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #0000ff">double</span><span style="color: #000000"> max </span><span style="color: #000000">=</span><span style="color: #000000"> Math.sqrt(n);<br /> <img id="Codehighlighter1_195_244_Open_Image" onclick="this.style.display='none'; Codehighlighter1_195_244_Open_Text.style.display='none'; Codehighlighter1_195_244_Closed_Image.style.display='inline'; Codehighlighter1_195_244_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_195_244_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_195_244_Closed_Text.style.display='none'; Codehighlighter1_195_244_Open_Image.style.display='inline'; Codehighlighter1_195_244_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.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">2</span><span style="color: #000000">; i </span><span style="color: #000000"><=</span><span style="color: #000000"> max; i</span><span style="color: #000000">++</span><span style="color: #000000">) </span><span id="Codehighlighter1_195_244_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 alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_195_244_Open_Text"><span style="color: #000000">{<br /> <img id="Codehighlighter1_216_240_Open_Image" onclick="this.style.display='none'; Codehighlighter1_216_240_Open_Text.style.display='none'; Codehighlighter1_216_240_Closed_Image.style.display='inline'; Codehighlighter1_216_240_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_216_240_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_216_240_Closed_Text.style.display='none'; Codehighlighter1_216_240_Open_Image.style.display='inline'; Codehighlighter1_216_240_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />            </span><span style="color: #0000ff">if</span><span style="color: #000000"> (n </span><span style="color: #000000">%</span><span style="color: #000000"> i </span><span style="color: #000000">==</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">) </span><span id="Codehighlighter1_216_240_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 alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_216_240_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #0000ff">false</span><span style="color: #000000">;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />            }</span></span><span style="color: #000000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span></span><span style="color: #000000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #0000ff">true</span><span style="color: #000000">;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />    }</span></span></div> <br />     问题的实现方法如下:(x)<br /> <div style="padding-right: 5px; padding-left: 4px; font-size: 13px; border-left-color: #cccccc; padding-bottom: 4px; width: 98%; word-break: break-all; padding-top: 4px; background-color: #eeeeee"><img id="Codehighlighter1_0_45_Open_Image" onclick="this.style.display='none'; Codehighlighter1_0_45_Open_Text.style.display='none'; Codehighlighter1_0_45_Closed_Image.style.display='inline'; Codehighlighter1_0_45_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_0_45_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_0_45_Closed_Text.style.display='none'; Codehighlighter1_0_45_Open_Image.style.display='inline'; Codehighlighter1_0_45_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /><span id="Codehighlighter1_0_45_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">/** */</span><span id="Codehighlighter1_0_45_Open_Text"><span style="color: #008000">/**</span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />     * 于n的质C?br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />     * </span><span style="color: #808080">@param</span><span style="color: #008000"> n<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />     * </span><span style="color: #808080">@return</span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />     </span><span style="color: #008000">*/</span></span><span style="color: #000000"><br /> <img id="Codehighlighter1_93_225_Open_Image" onclick="this.style.display='none'; Codehighlighter1_93_225_Open_Text.style.display='none'; Codehighlighter1_93_225_Closed_Image.style.display='inline'; Codehighlighter1_93_225_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_93_225_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_93_225_Closed_Text.style.display='none'; Codehighlighter1_93_225_Open_Image.style.display='inline'; Codehighlighter1_93_225_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" />    </span><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> Long getPrimeNumberSum(</span><span style="color: #0000ff">int</span><span style="color: #000000"> n) </span><span id="Codehighlighter1_93_225_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 alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_93_225_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />        </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">2</span><span style="color: #000000">;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />        Long sum </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">2L</span><span style="color: #000000">;<br /> <img id="Codehighlighter1_142_208_Open_Image" onclick="this.style.display='none'; Codehighlighter1_142_208_Open_Text.style.display='none'; Codehighlighter1_142_208_Closed_Image.style.display='inline'; Codehighlighter1_142_208_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_142_208_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_142_208_Closed_Text.style.display='none'; Codehighlighter1_142_208_Open_Image.style.display='inline'; Codehighlighter1_142_208_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />        </span><span style="color: #0000ff">while</span><span style="color: #000000"> (i </span><span style="color: #000000"><=</span><span style="color: #000000"> n) </span><span id="Codehighlighter1_142_208_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 alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_142_208_Open_Text"><span style="color: #000000">{<br /> <img id="Codehighlighter1_185_204_Open_Image" onclick="this.style.display='none'; Codehighlighter1_185_204_Open_Text.style.display='none'; Codehighlighter1_185_204_Closed_Image.style.display='inline'; Codehighlighter1_185_204_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_185_204_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_185_204_Closed_Text.style.display='none'; Codehighlighter1_185_204_Open_Image.style.display='inline'; Codehighlighter1_185_204_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />            </span><span style="color: #0000ff">if</span><span style="color: #000000"> (AlgorithmUtil.isPrimeNumber(</span><span style="color: #000000">++</span><span style="color: #000000">i)) </span><span id="Codehighlighter1_185_204_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 alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_185_204_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                sum </span><span style="color: #000000">+=</span><span style="color: #000000"> i;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />            }</span></span><span style="color: #000000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span></span><span style="color: #000000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> sum;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />    }</span></span></div> <br />     卛_得到{案<font style="background-color: #cce8cf">142913828922</font>?br /> <br />     E稍优化一下,<br /> <div style="padding-right: 5px; padding-left: 4px; font-size: 13px; border-left-color: #cccccc; padding-bottom: 4px; width: 98%; word-break: break-all; padding-top: 4px; background-color: #eeeeee"><img id="Codehighlighter1_1_51_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1_51_Open_Text.style.display='none'; Codehighlighter1_1_51_Closed_Image.style.display='inline'; Codehighlighter1_1_51_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_1_51_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1_51_Closed_Text.style.display='none'; Codehighlighter1_1_51_Open_Image.style.display='inline'; Codehighlighter1_1_51_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /><span style="color: #000000">    </span><span id="Codehighlighter1_1_51_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">/** */</span><span id="Codehighlighter1_1_51_Open_Text"><span style="color: #008000">/**</span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />     * 于n的质C?br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />     * <br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />     * </span><span style="color: #808080">@param</span><span style="color: #008000"> n<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />     * </span><span style="color: #808080">@return</span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />     </span><span style="color: #008000">*/</span></span><span style="color: #000000"><br /> <img id="Codehighlighter1_99_345_Open_Image" onclick="this.style.display='none'; Codehighlighter1_99_345_Open_Text.style.display='none'; Codehighlighter1_99_345_Closed_Image.style.display='inline'; Codehighlighter1_99_345_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_99_345_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_99_345_Closed_Text.style.display='none'; Codehighlighter1_99_345_Open_Image.style.display='inline'; Codehighlighter1_99_345_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" />    </span><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> Long getPrimeNumberSum(</span><span style="color: #0000ff">int</span><span style="color: #000000"> n) </span><span id="Codehighlighter1_99_345_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 alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_99_345_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />        </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">5</span><span style="color: #000000">;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />        Long sum </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">5L</span><span style="color: #000000">;</span><span style="color: #008000">//</span><span style="color: #008000">׃2Q?都是质数Q初始gؓ(f)5</span><span style="color: #008000"><br /> <img id="Codehighlighter1_165_328_Open_Image" onclick="this.style.display='none'; Codehighlighter1_165_328_Open_Text.style.display='none'; Codehighlighter1_165_328_Closed_Image.style.display='inline'; Codehighlighter1_165_328_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_165_328_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_165_328_Closed_Text.style.display='none'; Codehighlighter1_165_328_Open_Image.style.display='inline'; Codehighlighter1_165_328_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" /></span><span style="color: #000000">        </span><span style="color: #0000ff">while</span><span style="color: #000000"> (i </span><span style="color: #000000"><=</span><span style="color: #000000"> n) </span><span id="Codehighlighter1_165_328_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 alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_165_328_Open_Text"><span style="color: #000000">{<br /> <img id="Codehighlighter1_211_241_Open_Image" onclick="this.style.display='none'; Codehighlighter1_211_241_Open_Text.style.display='none'; Codehighlighter1_211_241_Closed_Image.style.display='inline'; Codehighlighter1_211_241_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_211_241_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_211_241_Closed_Text.style.display='none'; Codehighlighter1_211_241_Open_Image.style.display='inline'; Codehighlighter1_211_241_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />            </span><span style="color: #0000ff">if</span><span style="color: #000000"> (AlgorithmUtil.isPrimeNumber(i </span><span style="color: #000000">+=</span><span style="color: #000000"> </span><span style="color: #000000">2</span><span style="color: #000000">)) </span><span id="Codehighlighter1_211_241_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 alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_211_241_Open_Text"><span style="color: #000000">{</span><span style="color: #008000">//</span><span style="color: #008000">质数 不能?整除</span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">                sum </span><span style="color: #000000">+=</span><span style="color: #000000"> i;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />            }</span></span><span style="color: #000000"><br /> <img id="Codehighlighter1_297_324_Open_Image" onclick="this.style.display='none'; Codehighlighter1_297_324_Open_Text.style.display='none'; Codehighlighter1_297_324_Closed_Image.style.display='inline'; Codehighlighter1_297_324_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_297_324_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_297_324_Closed_Text.style.display='none'; Codehighlighter1_297_324_Open_Image.style.display='inline'; Codehighlighter1_297_324_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />            </span><span style="color: #0000ff">if</span><span style="color: #000000"> (i </span><span style="color: #000000"><=</span><span style="color: #000000"> n </span><span style="color: #000000">&&</span><span style="color: #000000"> AlgorithmUtil.isPrimeNumber(i </span><span style="color: #000000">+=</span><span style="color: #000000"> </span><span style="color: #000000">4</span><span style="color: #000000">)) </span><span id="Codehighlighter1_297_324_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 alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_297_324_Open_Text"><span style="color: #000000">{</span><span style="color: #008000">//</span><span style="color: #008000">不能?整除</span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">                sum </span><span style="color: #000000">+=</span><span style="color: #000000"> i;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />            }</span></span><span style="color: #000000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span></span><span style="color: #000000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> sum;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />    }</span></span></div>     q可以通过埃拉托斯特尼{法Q?a >http://zh.wikipedia.org/zh-cn/%E5%9F%83%E6%8B%89%E6%89%98%E6%96%AF%E7%89%B9%E5%B0%BC%E7%AD%9B%E6%B3%95</a>Q来质数之和?br /> <br />     请不吝赐教?br />     @anthor ClumsyBird <img src ="http://www.aygfsteel.com/zhou-zhihao/aggbug/338831.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/zhou-zhihao/" target="_blank">ClumsyBird</a> 2010-11-23 17:22 <a href="http://www.aygfsteel.com/zhou-zhihao/archive/2010/11/23/338831.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>问题9Q求毕达哥拉斯三元数l{a,b,c},使得a+b+cQ?000,l出a*b*chttp://www.aygfsteel.com/zhou-zhihao/archive/2010/11/23/338828.htmlClumsyBirdClumsyBirdTue, 23 Nov 2010 09:09:00 GMThttp://www.aygfsteel.com/zhou-zhihao/archive/2010/11/23/338828.htmlhttp://www.aygfsteel.com/zhou-zhihao/comments/338828.htmlhttp://www.aygfsteel.com/zhou-zhihao/archive/2010/11/23/338828.html#Feedback0http://www.aygfsteel.com/zhou-zhihao/comments/commentRss/338828.htmlhttp://www.aygfsteel.com/zhou-zhihao/services/trackbacks/338828.html         “毕达哥拉斯三元数l存在{a,b,c},a<b<c,使得a^2+b^2=c^2Q如3^2+4^2=5^2=25,求aQbQc满以上条gQƈ使a+b+c=1000,l出a*b*c的倹{?#8221;

    代码如下Q?br />
/**
     * 求毕辑֓拉斯三元数组{a,b,c},使得a+b+cQtarget . 毕达哥拉斯三元数l存在{a,b,c},a<b<c,使得a^2+b^2=c^2
     * a > 3,(target-(a+b))^2=c^2=a^2+b^2 --> target^2=2*target*(a+b)-2ab
     * 
     * 
@return
     
*/

    
private static int getNumber(int target) {
        
int a = 0;
        
int b = 0;
        
int c = 0;
        
for (int i = 3; i < target; i++{
            
for (int j = i; j < target; j++{
                
if (target * target == 2 * target * i + 2 * target * j - 2 * i
                        
* j) {// target^2=2*target*(a+b)-2ab
                    a = i;
                    b 
= j;
                    
break;
                }

            }

        }

        c 
= target - a - b;
        
return a * b * c;
    }

    具体的分析可以看代码注释。得出结?font style="background-color: #cce8cf">31875000?br />     除了(jin)直接的办法,应该q有另外的方法来求,保持未完待箋(hu)状态?br />     请不吝赐教?br />     @anthor ClumsyBird


ClumsyBird 2010-11-23 17:09 发表评论
]]>
问题8Q对?000位数值求?gu)l五位数值的最大乘U?/title><link>http://www.aygfsteel.com/zhou-zhihao/archive/2010/11/23/338804.html</link><dc:creator>ClumsyBird</dc:creator><author>ClumsyBird</author><pubDate>Tue, 23 Nov 2010 07:21:00 GMT</pubDate><guid>http://www.aygfsteel.com/zhou-zhihao/archive/2010/11/23/338804.html</guid><wfw:comment>http://www.aygfsteel.com/zhou-zhihao/comments/338804.html</wfw:comment><comments>http://www.aygfsteel.com/zhou-zhihao/archive/2010/11/23/338804.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/zhou-zhihao/comments/commentRss/338804.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/zhou-zhihao/services/trackbacks/338804.html</trackback:ping><description><![CDATA[<p><span style="font-size: 12pt">    <font style="background-color: #cce8cf"><span style="font-size: 12pt"><font style="background-color: #cce8cf">问题描述如下Q?br />         “<span id="wmqeeuq" class="Apple-style-span" style="font-weight: normal; word-spacing: 0px; text-transform: none; color: rgb(0,0,0); text-indent: 0px; line-height: normal; font-style: normal; font-family: Simsun; white-space: normal; letter-spacing: normal; border-collapse: separate; font-variant: normal; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span id="wmqeeuq" class="Apple-style-span" style="line-height: 20px; font-family: Arial, Verdana, Helvetica, sans-serif; text-align: justify">对于1000位数值求?gu)l五位数值的最大乘U,1000位连l数值如下:(x)<br />                     <span id="wmqeeuq" class="Apple-style-span" style="font-weight: normal; word-spacing: 0px; text-transform: none; color: rgb(0,0,0); text-indent: 0px; line-height: normal; font-style: normal; font-family: Simsun; white-space: normal; letter-spacing: normal; border-collapse: separate; font-variant: normal; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span id="wmqeeuq" class="Apple-style-span" style="font-family: 'courier new'; text-align: center">73167176531330624919225119674426574742355349194934<br />         96983520312774506326239<span style="color: red">57831</span>8016984801869478851843<br />         85861560789112949495459501737958331952853208805511<br />         12540698747158523863050715693290963295227443043557<br />         66896648950445244523161731856403098711121722383113<br />         62229893423380308135336276614282806444486645238749<br />         30358907296290491560440772390713810515859307960866<br />         70172427121883998797908792274921901699720888093776<br />         65727333001053367881220235421809751254540594752243<br />         52584907711670556013604839586446706324415722155397<br />         53697817977846174064955149290862569321978468622482<br />         83972241375657056057490261407972968652414535100474<br />         82166370484403199890008895243450658541227588666881<br />         16427171479924442928230863465674813919123162824586<br />         17866458359124566529476545682848912883142607690042<br />         24219022671055626321111109370544217506941658960408<br />         07198403850962455444362981230987879927244284909188<br />         84580156166097919133875499200524063689912560717606<br />         05886116467109405077541002256983155200055935729725<br />         71636269561882670428252483600823257530420752963450</span></span><br /> </span></span>                <br />                 如:(x)U色表示的连l?位数<span style="color: red">57831</span>Q其乘积?*7*8*3*1”<br />     代码实现如下Q?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 id="Codehighlighter1_50_407_Open_Image" onclick="this.style.display='none'; Codehighlighter1_50_407_Open_Text.style.display='none'; Codehighlighter1_50_407_Closed_Image.style.display='inline'; Codehighlighter1_50_407_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_50_407_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_50_407_Closed_Text.style.display='none'; Codehighlighter1_50_407_Open_Image.style.display='inline'; Codehighlighter1_50_407_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">int</span><span style="color: #000000"> getGreatestProductBy(String s) </span><span id="Codehighlighter1_50_407_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 alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_50_407_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #0000ff">int</span><span style="color: #000000"> max </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">;<br /> <img id="Codehighlighter1_110_390_Open_Image" onclick="this.style.display='none'; Codehighlighter1_110_390_Open_Text.style.display='none'; Codehighlighter1_110_390_Closed_Image.style.display='inline'; Codehighlighter1_110_390_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_110_390_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_110_390_Closed_Text.style.display='none'; Codehighlighter1_110_390_Open_Image.style.display='inline'; Codehighlighter1_110_390_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.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">0</span><span style="color: #000000">; i </span><span style="color: #000000"><</span><span style="color: #000000"> s.length() </span><span style="color: #000000">-</span><span style="color: #000000"> </span><span style="color: #000000">5</span><span style="color: #000000">; i</span><span style="color: #000000">++</span><span style="color: #000000">) </span><span id="Codehighlighter1_110_390_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 alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_110_390_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #0000ff">int</span><span style="color: #000000"> temp </span><span style="color: #000000">=</span><span style="color: #000000"> Integer.parseInt(s.charAt(i) </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #000000">""</span><span style="color: #000000">)<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                    </span><span style="color: #000000">*</span><span style="color: #000000"> Integer.parseInt(s.charAt(i </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: #000000">+</span><span style="color: #000000"> </span><span style="color: #000000">""</span><span style="color: #000000">)<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                    </span><span style="color: #000000">*</span><span style="color: #000000"> Integer.parseInt(s.charAt(i </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #000000">2</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">)<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                    </span><span style="color: #000000">*</span><span style="color: #000000"> Integer.parseInt(s.charAt(i </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #000000">3</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">)<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                    </span><span style="color: #000000">*</span><span style="color: #000000"> Integer.parseInt(s.charAt(i </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #000000">4</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">);<br /> <img id="Codehighlighter1_365_386_Open_Image" onclick="this.style.display='none'; Codehighlighter1_365_386_Open_Text.style.display='none'; Codehighlighter1_365_386_Closed_Image.style.display='inline'; Codehighlighter1_365_386_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_365_386_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_365_386_Closed_Text.style.display='none'; Codehighlighter1_365_386_Open_Image.style.display='inline'; Codehighlighter1_365_386_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />            </span><span style="color: #0000ff">if</span><span style="color: #000000"> (temp </span><span style="color: #000000">></span><span style="color: #000000"> max) </span><span id="Codehighlighter1_365_386_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 alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_365_386_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                max </span><span style="color: #000000">=</span><span style="color: #000000"> temp;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />            }</span></span><span style="color: #000000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span></span><span style="color: #000000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> max;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />    }</span></span></div> <p></font></span><span style="font-size: 12pt">得答?span class="Apple-style-span" style="font-weight: normal; word-spacing: 0px; text-transform: none; color: rgb(0,0,0); text-indent: 0px; line-height: normal; font-style: normal; font-family: Simsun; white-space: normal; letter-spacing: normal; border-collapse: separate; font-variant: normal; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span id="wmqeeuq" class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif; text-align: center; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px"><strong>40824</strong></span></span></span>?br /> <br />     请不吝赐教?br /> <span style="font-size: 10pt">    @anthor ClumsyBird</span><br /> </font></span></p> <img src ="http://www.aygfsteel.com/zhou-zhihao/aggbug/338804.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/zhou-zhihao/" target="_blank">ClumsyBird</a> 2010-11-23 15:21 <a href="http://www.aygfsteel.com/zhou-zhihao/archive/2010/11/23/338804.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>问题7Q求W?0001个质?/title><link>http://www.aygfsteel.com/zhou-zhihao/archive/2010/11/23/338788.html</link><dc:creator>ClumsyBird</dc:creator><author>ClumsyBird</author><pubDate>Tue, 23 Nov 2010 05:56:00 GMT</pubDate><guid>http://www.aygfsteel.com/zhou-zhihao/archive/2010/11/23/338788.html</guid><wfw:comment>http://www.aygfsteel.com/zhou-zhihao/comments/338788.html</wfw:comment><comments>http://www.aygfsteel.com/zhou-zhihao/archive/2010/11/23/338788.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/zhou-zhihao/comments/commentRss/338788.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/zhou-zhihao/services/trackbacks/338788.html</trackback:ping><description><![CDATA[<span style="font-size: 12pt">    问题描述如下Q?br />         “?个质Cؓ(f)Q?Q?Q?Q?Q?1Q?3Q那W?个质Cؓ(f)13Q求W?0001个质数?#8221;<br />     代码如下Q?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 id="Codehighlighter1_43_211_Open_Image" onclick="this.style.display='none'; Codehighlighter1_43_211_Open_Text.style.display='none'; Codehighlighter1_43_211_Closed_Image.style.display='inline'; Codehighlighter1_43_211_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_43_211_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_43_211_Closed_Text.style.display='none'; Codehighlighter1_43_211_Open_Image.style.display='inline'; Codehighlighter1_43_211_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">int</span><span style="color: #000000"> getPrimeNumberBy(</span><span style="color: #0000ff">int</span><span style="color: #000000"> n) </span><span id="Codehighlighter1_43_211_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.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_43_211_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">int</span><span style="color: #000000"> j </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </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">;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">int</span><span style="color: #000000"> result </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">;<br /> <img id="Codehighlighter1_105_191_Open_Image" onclick="this.style.display='none'; Codehighlighter1_105_191_Open_Text.style.display='none'; Codehighlighter1_105_191_Closed_Image.style.display='inline'; Codehighlighter1_105_191_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_105_191_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_105_191_Closed_Text.style.display='none'; Codehighlighter1_105_191_Open_Image.style.display='inline'; Codehighlighter1_105_191_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">while</span><span style="color: #000000"> (j </span><span style="color: #000000"><</span><span style="color: #000000"> n) </span><span id="Codehighlighter1_105_191_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.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_105_191_Open_Text"><span style="color: #000000">{<br /> <img id="Codehighlighter1_146_176_Open_Image" onclick="this.style.display='none'; Codehighlighter1_146_176_Open_Text.style.display='none'; Codehighlighter1_146_176_Closed_Image.style.display='inline'; Codehighlighter1_146_176_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_146_176_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_146_176_Closed_Text.style.display='none'; Codehighlighter1_146_176_Open_Image.style.display='inline'; Codehighlighter1_146_176_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />            </span><span style="color: #0000ff">if</span><span style="color: #000000"> (AlgorithmUtil.isPrimeNumber(i)) </span><span id="Codehighlighter1_146_176_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.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_146_176_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />                result </span><span style="color: #000000">=</span><span style="color: #000000"> i;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />                j</span><span style="color: #000000">++</span><span style="color: #000000">;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />            }</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            i </span><span style="color: #000000">+=</span><span style="color: #000000"> </span><span style="color: #000000">2</span><span style="color: #000000">;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />        }</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> result;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />    }</span></span></div> </span>    下面是判断质数的代码Q?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 id="Codehighlighter1_0_49_Open_Image" onclick="this.style.display='none'; Codehighlighter1_0_49_Open_Text.style.display='none'; Codehighlighter1_0_49_Closed_Image.style.display='inline'; Codehighlighter1_0_49_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_0_49_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_0_49_Closed_Text.style.display='none'; Codehighlighter1_0_49_Open_Image.style.display='inline'; Codehighlighter1_0_49_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /><span id="Codehighlighter1_0_49_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">/** */</span><span id="Codehighlighter1_0_49_Open_Text"><span style="color: #008000">/**</span><span style="color: #008000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />     * 判断是否是素?br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />     * <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />     * </span><span style="color: #808080">@param</span><span style="color: #008000"> n<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />     * </span><span style="color: #808080">@return</span><span style="color: #008000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />     </span><span style="color: #008000">*/</span></span><span style="color: #000000"><br /> <img id="Codehighlighter1_95_262_Open_Image" onclick="this.style.display='none'; Codehighlighter1_95_262_Open_Text.style.display='none'; Codehighlighter1_95_262_Closed_Image.style.display='inline'; Codehighlighter1_95_262_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_95_262_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_95_262_Closed_Text.style.display='none'; Codehighlighter1_95_262_Open_Image.style.display='inline'; Codehighlighter1_95_262_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">boolean</span><span style="color: #000000"> isPrimeNumber(</span><span style="color: #0000ff">int</span><span style="color: #000000"> n) </span><span id="Codehighlighter1_95_262_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.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_95_262_Open_Text"><span style="color: #000000">{<br /> <img id="Codehighlighter1_110_131_Open_Image" onclick="this.style.display='none'; Codehighlighter1_110_131_Open_Text.style.display='none'; Codehighlighter1_110_131_Closed_Image.style.display='inline'; Codehighlighter1_110_131_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_110_131_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_110_131_Closed_Text.style.display='none'; Codehighlighter1_110_131_Open_Image.style.display='inline'; Codehighlighter1_110_131_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">if</span><span style="color: #000000"> (n </span><span style="color: #000000"><</span><span style="color: #000000"> </span><span style="color: #000000">2</span><span style="color: #000000">) </span><span id="Codehighlighter1_110_131_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.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_110_131_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #0000ff">false</span><span style="color: #000000">;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />        }</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">double</span><span style="color: #000000"> max </span><span style="color: #000000">=</span><span style="color: #000000"> Math.sqrt(n);<br /> <img id="Codehighlighter1_195_244_Open_Image" onclick="this.style.display='none'; Codehighlighter1_195_244_Open_Text.style.display='none'; Codehighlighter1_195_244_Closed_Image.style.display='inline'; Codehighlighter1_195_244_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_195_244_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_195_244_Closed_Text.style.display='none'; Codehighlighter1_195_244_Open_Image.style.display='inline'; Codehighlighter1_195_244_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />        </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">2</span><span style="color: #000000">; i </span><span style="color: #000000"><=</span><span style="color: #000000"> max; i</span><span style="color: #000000">++</span><span style="color: #000000">) </span><span id="Codehighlighter1_195_244_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.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_195_244_Open_Text"><span style="color: #000000">{<br /> <img id="Codehighlighter1_216_240_Open_Image" onclick="this.style.display='none'; Codehighlighter1_216_240_Open_Text.style.display='none'; Codehighlighter1_216_240_Closed_Image.style.display='inline'; Codehighlighter1_216_240_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_216_240_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_216_240_Closed_Text.style.display='none'; Codehighlighter1_216_240_Open_Image.style.display='inline'; Codehighlighter1_216_240_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />            </span><span style="color: #0000ff">if</span><span style="color: #000000"> (n </span><span style="color: #000000">%</span><span style="color: #000000"> i </span><span style="color: #000000">==</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">) </span><span id="Codehighlighter1_216_240_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.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_216_240_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />                </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #0000ff">false</span><span style="color: #000000">;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />            }</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />        }</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #0000ff">true</span><span style="color: #000000">;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />    }</span></span></div>     psQ质C叫素数?br /> <br />     请不吝赐教?br />     @anthor ClumsyBird <img src ="http://www.aygfsteel.com/zhou-zhihao/aggbug/338788.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/zhou-zhihao/" target="_blank">ClumsyBird</a> 2010-11-23 13:56 <a href="http://www.aygfsteel.com/zhou-zhihao/archive/2010/11/23/338788.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>问题6Q求1?00的和qx(chng)与^方和的差?/title><link>http://www.aygfsteel.com/zhou-zhihao/archive/2010/11/23/338782.html</link><dc:creator>ClumsyBird</dc:creator><author>ClumsyBird</author><pubDate>Tue, 23 Nov 2010 05:37:00 GMT</pubDate><guid>http://www.aygfsteel.com/zhou-zhihao/archive/2010/11/23/338782.html</guid><wfw:comment>http://www.aygfsteel.com/zhou-zhihao/comments/338782.html</wfw:comment><comments>http://www.aygfsteel.com/zhou-zhihao/archive/2010/11/23/338782.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/zhou-zhihao/comments/commentRss/338782.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/zhou-zhihao/services/trackbacks/338782.html</trackback:ping><description><![CDATA[<p>   <span style="font-size: 12pt"> 问题描述如下Q?br />         “1?0的^方和为:(x)1^2 + 2^2 + ... + 10^2 = 385Q和qx(chng)为:(x)(1 + 2 + ... + 10)^2 = 55^2 = 3025Q他们之间的差ؓ(f)3025Q?85Q?640Q求1?00的和qx(chng)与^方和之间的差|”<br /> <br />     代码实现如下Q?/span><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 id="Codehighlighter1_1_54_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1_54_Open_Text.style.display='none'; Codehighlighter1_1_54_Closed_Image.style.display='inline'; Codehighlighter1_1_54_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_1_54_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1_54_Closed_Text.style.display='none'; Codehighlighter1_1_54_Open_Image.style.display='inline'; Codehighlighter1_1_54_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /><span style="color: #000000">    </span><span id="Codehighlighter1_1_54_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">/** */</span><span id="Codehighlighter1_1_54_Open_Text"><span style="color: #008000">/**</span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />     * 求前n个自然数和^方与qx(chng)和之?br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />     * </span><span style="color: #808080">@param</span><span style="color: #008000"> n<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />     * </span><span style="color: #808080">@return</span><span style="color: #008000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />     </span><span style="color: #008000">*/</span></span><span style="color: #000000"><br /> <img id="Codehighlighter1_97_241_Open_Image" onclick="this.style.display='none'; Codehighlighter1_97_241_Open_Text.style.display='none'; Codehighlighter1_97_241_Closed_Image.style.display='inline'; Codehighlighter1_97_241_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_97_241_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_97_241_Closed_Text.style.display='none'; Codehighlighter1_97_241_Open_Image.style.display='inline'; Codehighlighter1_97_241_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" />    </span><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">int</span><span style="color: #000000"> getDifference(</span><span style="color: #0000ff">int</span><span style="color: #000000"> n) </span><span id="Codehighlighter1_97_241_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 alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_97_241_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #0000ff">int</span><span style="color: #000000"> first </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #0000ff">int</span><span style="color: #000000"> second </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">;<br /> <img id="Codehighlighter1_165_204_Open_Image" onclick="this.style.display='none'; Codehighlighter1_165_204_Open_Text.style.display='none'; Codehighlighter1_165_204_Closed_Image.style.display='inline'; Codehighlighter1_165_204_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_165_204_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_165_204_Closed_Text.style.display='none'; Codehighlighter1_165_204_Open_Image.style.display='inline'; Codehighlighter1_165_204_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.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"> n; i</span><span style="color: #000000">++</span><span style="color: #000000">) </span><span id="Codehighlighter1_165_204_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 alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_165_204_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            first </span><span style="color: #000000">+=</span><span style="color: #000000"> i </span><span style="color: #000000">*</span><span style="color: #000000"> i;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            second </span><span style="color: #000000">+=</span><span style="color: #000000"> i;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span></span><span style="color: #000000"><br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> second </span><span style="color: #000000">*</span><span style="color: #000000"> second </span><span style="color: #000000">-</span><span style="color: #000000"> first;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />    }</span></span></div>   <span style="font-size: 12pt">  可以得到{案25164150?br /> <br />     我们q可以用数学的Ҏ(gu)来解此题?br />     1^2 + 2^2 + ... + n^2 =n(n+1)(2n+1)/6<br />     (1+2+3+...+n)^2 =(n(n+1)/2)^2<br />     相关证明可以d体的?jin)解Q如Q?br />     (n+1)^3 -(n-1)^3 =6n^2+2提示Q证明^方和公式Q?到n的求和公式就不提CZ(jin)<br />     l出代码Q?/span><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 id="Codehighlighter1_42_97_Open_Image" onclick="this.style.display='none'; Codehighlighter1_42_97_Open_Text.style.display='none'; Codehighlighter1_42_97_Closed_Image.style.display='inline'; Codehighlighter1_42_97_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_42_97_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_42_97_Closed_Text.style.display='none'; Codehighlighter1_42_97_Open_Image.style.display='inline'; Codehighlighter1_42_97_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /><span style="color: #000000">    </span><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">int</span><span style="color: #000000"> getDifference1(</span><span style="color: #0000ff">int</span><span style="color: #000000"> n) </span><span id="Codehighlighter1_42_97_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 alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span><span id="Codehighlighter1_42_97_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> (n</span><span style="color: #000000">*</span><span style="color: #000000">(n</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">2</span><span style="color: #000000">)</span><span style="color: #000000">*</span><span style="color: #000000">(n</span><span style="color: #000000">*</span><span style="color: #000000">(n</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">2</span><span style="color: #000000">)</span><span style="color: #000000">-</span><span style="color: #000000">n</span><span style="color: #000000">*</span><span style="color: #000000">(n</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">2</span><span style="color: #000000">*</span><span style="color: #000000">n</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">6</span><span style="color: #000000">;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />    }</span></span></div> <br />     到此l束Q请不吝赐教?br />     @anthor ClumsyBird <img src ="http://www.aygfsteel.com/zhou-zhihao/aggbug/338782.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/zhou-zhihao/" target="_blank">ClumsyBird</a> 2010-11-23 13:37 <a href="http://www.aygfsteel.com/zhou-zhihao/archive/2010/11/23/338782.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>问题5Q求能被1?0所整除的最的?/title><link>http://www.aygfsteel.com/zhou-zhihao/archive/2010/11/23/338780.html</link><dc:creator>ClumsyBird</dc:creator><author>ClumsyBird</author><pubDate>Tue, 23 Nov 2010 05:14:00 GMT</pubDate><guid>http://www.aygfsteel.com/zhou-zhihao/archive/2010/11/23/338780.html</guid><wfw:comment>http://www.aygfsteel.com/zhou-zhihao/comments/338780.html</wfw:comment><comments>http://www.aygfsteel.com/zhou-zhihao/archive/2010/11/23/338780.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/zhou-zhihao/comments/commentRss/338780.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/zhou-zhihao/services/trackbacks/338780.html</trackback:ping><description><![CDATA[<p><span style="font-size: 10pt"><span style="font-size: 10pt"> <span style="font-size: 12pt">   问题叙述如下Q?br /> <span id="wmqeeuq" class="Apple-style-span" style="font-weight: normal; word-spacing: 0px; text-transform: none; color: rgb(0,0,0); text-indent: 0px; line-height: normal; font-style: normal; font-family: Simsun; white-space: normal; letter-spacing: normal; border-collapse: separate; font-variant: normal; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">    “2520是最的数能够整??0Q求能被1?0所整除的最的敎ͼ”<br />   代码如下Q?br /> </span></span></span></span><span id="wmqeeuq" class="Apple-style-span" style="word-spacing: 0px; font: medium Simsun; text-transform: none; color: rgb(0,0,0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"></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"><span style="font-size: 10pt"><span style="font-size: 10pt"><img id="Codehighlighter1_0_76_Open_Image" onclick="this.style.display='none'; Codehighlighter1_0_76_Open_Text.style.display='none'; Codehighlighter1_0_76_Closed_Image.style.display='inline'; Codehighlighter1_0_76_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_0_76_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_0_76_Closed_Text.style.display='none'; Codehighlighter1_0_76_Open_Image.style.display='inline'; Codehighlighter1_0_76_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /><span id="Codehighlighter1_0_76_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">/** */</span></span></span><span id="Codehighlighter1_0_76_Open_Text"><span style="color: #008000"><span style="font-size: 10pt"><span style="font-size: 10pt">/**</span></span></span><span style="color: #008000"><br /> <span style="font-size: 10pt"><span style="font-size: 10pt"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />     * 数字i从m到nQ遍历,如果i不能被result整除Q我们就i除以i与result的最大公U数Qƈ与当前result想乘<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />     *<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />     </span></span></span><span style="color: #008000"><span style="font-size: 10pt"><span style="font-size: 10pt">*/</span></span></span></span><span style="color: #000000"><br /> <span style="font-size: 10pt"><span style="font-size: 10pt"><img id="Codehighlighter1_122_263_Open_Image" onclick="this.style.display='none'; Codehighlighter1_122_263_Open_Text.style.display='none'; Codehighlighter1_122_263_Closed_Image.style.display='inline'; Codehighlighter1_122_263_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_122_263_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_122_263_Closed_Text.style.display='none'; Codehighlighter1_122_263_Open_Image.style.display='inline'; Codehighlighter1_122_263_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" />    </span></span></span><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">int</span><span style="color: #000000"> getNumber(</span><span style="color: #0000ff">int</span><span style="color: #000000"> m, </span><span style="color: #0000ff">int</span><span style="color: #000000"> n) </span><span id="Codehighlighter1_122_263_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 alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span></span></span><span id="Codehighlighter1_122_263_Open_Text"><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #0000ff">int</span><span style="color: #000000"> result </span><span style="color: #000000">=</span></span></span><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #000000"> n;<br /> <img id="Codehighlighter1_177_243_Open_Image" onclick="this.style.display='none'; Codehighlighter1_177_243_Open_Text.style.display='none'; Codehighlighter1_177_243_Closed_Image.style.display='inline'; Codehighlighter1_177_243_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_177_243_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_177_243_Closed_Text.style.display='none'; Codehighlighter1_177_243_Open_Image.style.display='inline'; Codehighlighter1_177_243_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.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"> n </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"> m; i</span><span style="color: #000000">--</span><span style="color: #000000">) </span><span id="Codehighlighter1_177_243_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 alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span></span></span><span id="Codehighlighter1_177_243_Open_Text"><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #000000">{<br /> <img id="Codehighlighter1_203_239_Open_Image" onclick="this.style.display='none'; Codehighlighter1_203_239_Open_Text.style.display='none'; Codehighlighter1_203_239_Closed_Image.style.display='inline'; Codehighlighter1_203_239_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_203_239_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_203_239_Closed_Text.style.display='none'; Codehighlighter1_203_239_Open_Image.style.display='inline'; Codehighlighter1_203_239_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />            </span><span style="color: #0000ff">if</span><span style="color: #000000"> (result </span><span style="color: #000000">%</span><span style="color: #000000"> i </span><span style="color: #000000">!=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">) </span><span id="Codehighlighter1_203_239_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 alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span></span></span><span id="Codehighlighter1_203_239_Open_Text"><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />                result </span><span style="color: #000000">*=</span><span style="color: #000000"> i</span><span style="color: #000000">/</span></span></span><span style="color: #000000"><span style="font-size: 10pt"><span style="font-size: 10pt">gcd(result,i);<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />            }</span></span></span></span><span style="color: #000000"><br /> <span style="font-size: 10pt"><span style="font-size: 10pt"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span></span></span></span><span style="color: #000000"><br /> <span style="font-size: 10pt"><span style="font-size: 10pt"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span></span></span><span style="color: #0000ff"><span style="font-size: 10pt"><span style="font-size: 10pt">return</span></span></span><span style="color: #000000"><span style="font-size: 10pt"><span style="font-size: 10pt"> result;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />    }</span></span></span></span><span style="color: #000000"><br /> <span style="font-size: 10pt"><span style="font-size: 10pt"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img id="Codehighlighter1_267_363_Open_Image" onclick="this.style.display='none'; Codehighlighter1_267_363_Open_Text.style.display='none'; Codehighlighter1_267_363_Closed_Image.style.display='inline'; Codehighlighter1_267_363_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_267_363_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_267_363_Closed_Text.style.display='none'; Codehighlighter1_267_363_Open_Image.style.display='inline'; Codehighlighter1_267_363_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" />    </span></span></span><span id="Codehighlighter1_267_363_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"><span style="font-size: 10pt"><span style="font-size: 10pt">/** */</span></span></span><span id="Codehighlighter1_267_363_Open_Text"><span style="color: #008000"><span style="font-size: 10pt"><span style="font-size: 10pt">/**</span></span></span><span style="color: #008000"><br /> <span style="font-size: 10pt"><span style="font-size: 10pt"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />     * 最大公U数Q欧几里L(fng)?nbsp;定理Qgcd(a,b) = gcd(b,a mod b)<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />     * <br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />     * </span></span></span><span style="color: #808080"><span style="font-size: 10pt"><span style="font-size: 10pt">@param</span></span></span><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #008000"> a<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />     * </span><span style="color: #808080">@param</span></span></span><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #008000"> b<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />     * </span><span style="color: #808080">@return</span></span></span><span style="color: #008000"><br /> <span style="font-size: 10pt"><span style="font-size: 10pt"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />     </span></span></span><span style="color: #008000"><span style="font-size: 10pt"><span style="font-size: 10pt">*/</span></span></span></span><span style="color: #000000"><br /> <span style="font-size: 10pt"><span style="font-size: 10pt"><img id="Codehighlighter1_403_465_Open_Image" onclick="this.style.display='none'; Codehighlighter1_403_465_Open_Text.style.display='none'; Codehighlighter1_403_465_Closed_Image.style.display='inline'; Codehighlighter1_403_465_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_403_465_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_403_465_Closed_Text.style.display='none'; Codehighlighter1_403_465_Open_Image.style.display='inline'; Codehighlighter1_403_465_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" />    </span></span></span><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">int</span><span style="color: #000000"> gcd(</span><span style="color: #0000ff">int</span><span style="color: #000000"> a, </span><span style="color: #0000ff">int</span><span style="color: #000000"> b) </span><span id="Codehighlighter1_403_465_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 alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span></span></span><span id="Codehighlighter1_403_465_Open_Text"><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #0000ff">if</span><span style="color: #000000"> (b </span><span style="color: #000000">!=</span><span style="color: #000000"> </span><span style="color: #000000">0</span></span></span><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #000000">)<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #0000ff">return</span><span style="color: #000000"> gcd(b, a </span><span style="color: #000000">%</span></span></span><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #000000"> b);<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #0000ff">else</span></span></span><span style="color: #000000"><br /> <span style="font-size: 10pt"><span style="font-size: 10pt"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span></span></span><span style="color: #0000ff"><span style="font-size: 10pt"><span style="font-size: 10pt">return</span></span></span><span style="color: #000000"><span style="font-size: 10pt"><span style="font-size: 10pt"> a;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />    }</span></span></span></span></div> <p><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="font-size: 12pt">    调用getNumber(1,20)卛_得到{案<font style="background-color: #cce8cf">232792560</font><strong>?br /> </strong>    ׃在此用到最大公U数Q所以在下面l出?jin)一些实现?/span></span></span></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"><span style="font-size: 10pt"><span style="font-size: 10pt"><img id="Codehighlighter1_1_63_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1_63_Open_Text.style.display='none'; Codehighlighter1_1_63_Closed_Image.style.display='inline'; Codehighlighter1_1_63_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_1_63_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1_63_Closed_Text.style.display='none'; Codehighlighter1_1_63_Open_Image.style.display='inline'; Codehighlighter1_1_63_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /><span style="color: #000000">    </span><span id="Codehighlighter1_1_63_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">/** */</span></span></span><span id="Codehighlighter1_1_63_Open_Text"><span style="color: #008000"><span style="font-size: 10pt"><span style="font-size: 10pt">/**</span></span></span><span style="color: #008000"><br /> <span style="font-size: 10pt"><span style="font-size: 10pt"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />     * 最大公U数Q欧几里L(fng)?br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />     * </span></span></span><span style="color: #808080"><span style="font-size: 10pt"><span style="font-size: 10pt">@param</span></span></span><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #008000"> a<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />     * </span><span style="color: #808080">@param</span></span></span><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #008000"> b<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />     * </span><span style="color: #808080">@return</span></span></span><span style="color: #008000"><br /> <span style="font-size: 10pt"><span style="font-size: 10pt"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />     </span></span></span><span style="color: #008000"><span style="font-size: 10pt"><span style="font-size: 10pt">*/</span></span></span></span><span style="color: #000000"><br /> <span style="font-size: 10pt"><span style="font-size: 10pt"><img id="Codehighlighter1_104_233_Open_Image" onclick="this.style.display='none'; Codehighlighter1_104_233_Open_Text.style.display='none'; Codehighlighter1_104_233_Closed_Image.style.display='inline'; Codehighlighter1_104_233_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_104_233_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_104_233_Closed_Text.style.display='none'; Codehighlighter1_104_233_Open_Image.style.display='inline'; Codehighlighter1_104_233_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" />    </span></span></span><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">int</span><span style="color: #000000"> gcd1(</span><span style="color: #0000ff">int</span><span style="color: #000000"> a, </span><span style="color: #0000ff">int</span><span style="color: #000000"> b) </span><span id="Codehighlighter1_104_233_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 alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span></span></span><span id="Codehighlighter1_104_233_Open_Text"><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #000000">{<br /> <img id="Codehighlighter1_119_138_Open_Image" onclick="this.style.display='none'; Codehighlighter1_119_138_Open_Text.style.display='none'; Codehighlighter1_119_138_Closed_Image.style.display='inline'; Codehighlighter1_119_138_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_119_138_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_119_138_Closed_Text.style.display='none'; Codehighlighter1_119_138_Open_Image.style.display='inline'; Codehighlighter1_119_138_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />        </span><span style="color: #0000ff">if</span><span style="color: #000000"> (a </span><span style="color: #000000">></span><span style="color: #000000"> b) </span><span id="Codehighlighter1_119_138_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 alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span></span></span><span id="Codehighlighter1_119_138_Open_Text"><span style="color: #000000"><span style="font-size: 10pt"><span style="font-size: 10pt">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            gcd1(b, a);<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span></span></span></span><span style="color: #000000"><br /> <span style="font-size: 10pt"><span style="font-size: 10pt"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span></span></span><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #0000ff">int</span><span style="color: #000000"> temp </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span></span></span><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #000000">;<br /> <img id="Codehighlighter1_174_218_Open_Image" onclick="this.style.display='none'; Codehighlighter1_174_218_Open_Text.style.display='none'; Codehighlighter1_174_218_Closed_Image.style.display='inline'; Codehighlighter1_174_218_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_174_218_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_174_218_Closed_Text.style.display='none'; Codehighlighter1_174_218_Open_Image.style.display='inline'; Codehighlighter1_174_218_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />        </span><span style="color: #0000ff">for</span><span style="color: #000000"> (; b </span><span style="color: #000000">!=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">;) </span><span id="Codehighlighter1_174_218_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 alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span></span></span><span id="Codehighlighter1_174_218_Open_Text"><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            temp </span><span style="color: #000000">=</span><span style="color: #000000"> a </span><span style="color: #000000">%</span></span></span><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #000000"> b;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            a </span><span style="color: #000000">=</span></span></span><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #000000"> b;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            b </span><span style="color: #000000">=</span></span></span><span style="color: #000000"><span style="font-size: 10pt"><span style="font-size: 10pt"> temp;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span></span></span></span><span style="color: #000000"><br /> <span style="font-size: 10pt"><span style="font-size: 10pt"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span></span></span><span style="color: #0000ff"><span style="font-size: 10pt"><span style="font-size: 10pt">return</span></span></span><span style="color: #000000"><span style="font-size: 10pt"><span style="font-size: 10pt"> a;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />    }</span></span></span></span><span style="color: #000000"><br /> <span style="font-size: 10pt"><span style="font-size: 10pt"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img id="Codehighlighter1_237_384_Open_Image" onclick="this.style.display='none'; Codehighlighter1_237_384_Open_Text.style.display='none'; Codehighlighter1_237_384_Closed_Image.style.display='inline'; Codehighlighter1_237_384_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_237_384_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_237_384_Closed_Text.style.display='none'; Codehighlighter1_237_384_Open_Image.style.display='inline'; Codehighlighter1_237_384_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" />    </span></span></span><span id="Codehighlighter1_237_384_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"><span style="font-size: 10pt"><span style="font-size: 10pt">/** */</span></span></span><span id="Codehighlighter1_237_384_Open_Text"><span style="color: #008000"><span style="font-size: 10pt"><span style="font-size: 10pt">/**</span></span></span><span style="color: #008000"><br /> <span style="font-size: 10pt"><span style="font-size: 10pt"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />     * 最大公U数QStein法 gcd(ka,kb) = k gcd(a,b)Q也是最大公U数q算和倍乘q算可以交换Q?br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />     * Ҏ(gu)的,当k=2Ӟ说明两个偶数的最大公U数必然能被2整除<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />     * <br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />     * </span></span></span><span style="color: #808080"><span style="font-size: 10pt"><span style="font-size: 10pt">@param</span></span></span><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #008000"> a<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />     * </span><span style="color: #808080">@param</span></span></span><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #008000"> b<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />     * </span><span style="color: #808080">@return</span></span></span><span style="color: #008000"><br /> <span style="font-size: 10pt"><span style="font-size: 10pt"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />     </span></span></span><span style="color: #008000"><span style="font-size: 10pt"><span style="font-size: 10pt">*/</span></span></span></span><span style="color: #000000"><br /> <span style="font-size: 10pt"><span style="font-size: 10pt"><img id="Codehighlighter1_431_776_Open_Image" onclick="this.style.display='none'; Codehighlighter1_431_776_Open_Text.style.display='none'; Codehighlighter1_431_776_Closed_Image.style.display='inline'; Codehighlighter1_431_776_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_431_776_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_431_776_Closed_Text.style.display='none'; Codehighlighter1_431_776_Open_Image.style.display='inline'; Codehighlighter1_431_776_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" />    </span></span></span><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">int</span><span style="color: #000000"> gcdByStein(</span><span style="color: #0000ff">int</span><span style="color: #000000"> a, </span><span style="color: #0000ff">int</span><span style="color: #000000"> b) </span><span id="Codehighlighter1_431_776_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 alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span></span></span><span id="Codehighlighter1_431_776_Open_Text"><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #000000">{<br /> <img id="Codehighlighter1_446_471_Open_Image" onclick="this.style.display='none'; Codehighlighter1_446_471_Open_Text.style.display='none'; Codehighlighter1_446_471_Closed_Image.style.display='inline'; Codehighlighter1_446_471_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_446_471_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_446_471_Closed_Text.style.display='none'; Codehighlighter1_446_471_Open_Image.style.display='inline'; Codehighlighter1_446_471_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />        </span><span style="color: #0000ff">if</span><span style="color: #000000"> (a </span><span style="color: #000000">></span><span style="color: #000000"> b) </span><span id="Codehighlighter1_446_471_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 alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span></span></span><span id="Codehighlighter1_446_471_Open_Text"><span style="color: #000000"><span style="font-size: 10pt"><span style="font-size: 10pt">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            gcdByStein(b, a);<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span></span></span></span><span style="color: #000000"><br /> <span style="font-size: 10pt"><span style="font-size: 10pt"><img id="Codehighlighter1_487_504_Open_Image" onclick="this.style.display='none'; Codehighlighter1_487_504_Open_Text.style.display='none'; Codehighlighter1_487_504_Closed_Image.style.display='inline'; Codehighlighter1_487_504_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_487_504_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_487_504_Closed_Text.style.display='none'; Codehighlighter1_487_504_Open_Image.style.display='inline'; Codehighlighter1_487_504_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />        </span></span></span><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #0000ff">if</span><span style="color: #000000"> (b </span><span style="color: #000000">==</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">) </span><span id="Codehighlighter1_487_504_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 alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span></span></span><span id="Codehighlighter1_487_504_Open_Text"><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #0000ff">return</span></span></span><span style="color: #000000"><span style="font-size: 10pt"><span style="font-size: 10pt"> a;<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span></span></span></span><span style="color: #000000"><br /> <span style="font-size: 10pt"><span style="font-size: 10pt"><img id="Codehighlighter1_538_591_Open_Image" onclick="this.style.display='none'; Codehighlighter1_538_591_Open_Text.style.display='none'; Codehighlighter1_538_591_Closed_Image.style.display='inline'; Codehighlighter1_538_591_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_538_591_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_538_591_Closed_Text.style.display='none'; Codehighlighter1_538_591_Open_Image.style.display='inline'; Codehighlighter1_538_591_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />        </span></span></span><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #0000ff">if</span><span style="color: #000000"> (a </span><span style="color: #000000">%</span><span style="color: #000000"> </span><span style="color: #000000">2</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"> </span><span style="color: #000000">&&</span><span style="color: #000000"> b </span><span style="color: #000000">%</span><span style="color: #000000"> </span><span style="color: #000000">2</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">) </span><span id="Codehighlighter1_538_591_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 alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span></span></span><span id="Codehighlighter1_538_591_Open_Text"><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #000000">2</span><span style="color: #000000"> </span><span style="color: #000000">*</span><span style="color: #000000"> gcdByStein(a </span><span style="color: #000000">/</span><span style="color: #000000"> </span><span style="color: #000000">2</span><span style="color: #000000">, b </span><span style="color: #000000">/</span><span style="color: #000000"> </span><span style="color: #000000">2</span><span style="color: #000000">);</span><span style="color: #008000">//</span><span style="color: #008000">a,b都是偶数</span></span></span><span style="color: #008000"><br /> <span style="font-size: 10pt"><span style="font-size: 10pt"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" /></span></span></span><span style="color: #000000"><span style="font-size: 10pt"><span style="font-size: 10pt">        }</span></span></span></span><span style="color: #000000"><br /> <span style="font-size: 10pt"><span style="font-size: 10pt"><img id="Codehighlighter1_611_654_Open_Image" onclick="this.style.display='none'; Codehighlighter1_611_654_Open_Text.style.display='none'; Codehighlighter1_611_654_Closed_Image.style.display='inline'; Codehighlighter1_611_654_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_611_654_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_611_654_Closed_Text.style.display='none'; Codehighlighter1_611_654_Open_Image.style.display='inline'; Codehighlighter1_611_654_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />        </span></span></span><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #0000ff">if</span><span style="color: #000000"> (a </span><span style="color: #000000">%</span><span style="color: #000000"> </span><span style="color: #000000">2</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">) </span><span id="Codehighlighter1_611_654_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 alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span></span></span><span id="Codehighlighter1_611_654_Open_Text"><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #0000ff">return</span><span style="color: #000000"> gcdByStein(a </span><span style="color: #000000">/</span><span style="color: #000000"> </span><span style="color: #000000">2</span><span style="color: #000000">, b);</span><span style="color: #008000">//</span><span style="color: #008000">仅a为偶?/span></span></span><span style="color: #008000"><br /> <span style="font-size: 10pt"><span style="font-size: 10pt"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" /></span></span></span><span style="color: #000000"><span style="font-size: 10pt"><span style="font-size: 10pt">        }</span></span></span></span><span style="color: #000000"><br /> <span style="font-size: 10pt"><span style="font-size: 10pt"><img id="Codehighlighter1_674_717_Open_Image" onclick="this.style.display='none'; Codehighlighter1_674_717_Open_Text.style.display='none'; Codehighlighter1_674_717_Closed_Image.style.display='inline'; Codehighlighter1_674_717_Closed_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_674_717_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_674_717_Closed_Text.style.display='none'; Codehighlighter1_674_717_Open_Image.style.display='inline'; Codehighlighter1_674_717_Open_Text.style.display='inline';" alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />        </span></span></span><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #0000ff">if</span><span style="color: #000000"> (b </span><span style="color: #000000">%</span><span style="color: #000000"> </span><span style="color: #000000">2</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">) </span><span id="Codehighlighter1_674_717_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 alt="" src="http://www.aygfsteel.com/Images/dot.gif" /></span></span></span><span id="Codehighlighter1_674_717_Open_Text"><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #000000">{<br /> <img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #0000ff">return</span><span style="color: #000000"> gcdByStein(a, b </span><span style="color: #000000">/</span><span style="color: #000000"> </span><span style="color: #000000">2</span><span style="color: #000000">);</span><span style="color: #008000">//</span><span style="color: #008000">仅b为偶?/span></span></span><span style="color: #008000"><br /> <span style="font-size: 10pt"><span style="font-size: 10pt"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" /></span></span></span><span style="color: #000000"><span style="font-size: 10pt"><span style="font-size: 10pt">        }</span></span></span></span><span style="color: #000000"><br /> <span style="font-size: 10pt"><span style="font-size: 10pt"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span></span></span><span style="font-size: 10pt"><span style="font-size: 10pt"><span style="color: #0000ff">return</span><span style="color: #000000"> gcdByStein((a </span><span style="color: #000000">+</span><span style="color: #000000"> b) </span><span style="color: #000000">/</span><span style="color: #000000"> </span><span style="color: #000000">2</span><span style="color: #000000">, (a </span><span style="color: #000000">-</span><span style="color: #000000"> b) </span><span style="color: #000000">/</span><span style="color: #000000"> </span><span style="color: #000000">2</span><span style="color: #000000">);</span><span style="color: #008000">//</span><span style="color: #008000">a,b都是奇数</span></span></span><span style="color: #008000"><br /> <span style="font-size: 10pt"><span style="font-size: 10pt"><img alt="" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" /></span></span></span><span style="color: #000000"><span style="font-size: 10pt"><span style="font-size: 10pt">    }</span></span></span></span></div> <p><span style="font-size: 10pt"><span style="font-size: 12pt">    如果有其他的Ҏ(gu)Q也误(chung)出大家一赯论。^_^<br />     请不吝赐教?br />     <span style="font-family: Arial">@anthor ClumsyBird</span></span></span></span></p> <img src ="http://www.aygfsteel.com/zhou-zhihao/aggbug/338780.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/zhou-zhihao/" target="_blank">ClumsyBird</a> 2010-11-23 13:14 <a href="http://www.aygfsteel.com/zhou-zhihao/archive/2010/11/23/338780.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>eclipse 常用快捷键ȝhttp://www.aygfsteel.com/zhou-zhihao/archive/2010/11/11/337769.htmlClumsyBirdClumsyBirdWed, 10 Nov 2010 16:11:00 GMThttp://www.aygfsteel.com/zhou-zhihao/archive/2010/11/11/337769.htmlhttp://www.aygfsteel.com/zhou-zhihao/comments/337769.htmlhttp://www.aygfsteel.com/zhou-zhihao/archive/2010/11/11/337769.html#Feedback0http://www.aygfsteel.com/zhou-zhihao/comments/commentRss/337769.htmlhttp://www.aygfsteel.com/zhou-zhihao/services/trackbacks/337769.html    Elcipse~辑功能比较强大Q掌握eclipse快捷键,?x)很好的提高开发效率,下面是一些常用快捷键介绍?br />     1. [ALT+/] 
        能ؓ(f)用户提供内容的辅助,不要不全Ҏ(gu)和属性名U犯愁,当记不全cR方法和属性的名字?可以使用它?br />     2. [Ctrl+O]
        昄cMҎ(gu)和属性的大纲Q能快速定位类的方法和属性?br />     3. [Ctrl+/][Ctrl+Shift+/][Ctrl+Shift+\]
        d或取消注?/Q?span style="font-size: 12pt; font-family: ?hu)? mso-bidi-font-family: ?hu)? mso-font-kerning: 0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">加上D|?span lang="EN-US">/**/,
取消D|?span lang="EN-US">/**/
    4. [Ctrl+D][Ctrl+Delete/Backspace][Ctrl+Shift+Delete]
        删除当前?删除下一?span lang="EN-US">/上一个单?/span>,删除到行?/span>
    5. [Ctrl+M]
        H口最大化和还原?br />     6. [Ctrl+K][Ctrl++Shift+K]
        快速向下和向上查找选定的内宏V?br />     7. [Ctrl+Shift+T]
        查找Workspace构徏路径中可扑ֈ?span lang="EN-US">JavacLӞ而且可以使用“*”?span lang="EN-US">“
Q?span lang="EN-US">”
{通配W?br />     8. [Ctrl+Shift+R]
        和[Ctrl+Shift+T]对应Q查?span lang="EN-US">Workspace中的所有文Ӟ包括Java文gQ,也可以用通配W?br />     9. [Ctrl+Shift+G][Ctrl+Alt+G][Ctrl+G]
        搜烦(ch)选中元素的引?/span>,搜烦(ch)选中的文?/span>,搜烦(ch)选中元素的声?/span>
    10. [Ctrl+Shift+O][Ctrl+Shift+M]
        快速生成import,d选中导入
    11. [Ctrl+Shift+F]
        格式化代码?br />     12. [ALT+Shift+W]
        快速定位浏览器视图的位|?br />     13. [Ctrl+L]
        定位到某一行?br />     14. [Alt+←][Alt+]
        后退前进历史记录?br />     15. [F3][Ctr+鼠标左键]
        快速定位光标处的某个方法,属性或者类?br />     16. [F4]
        昄cȝl承关系Qƈ打开cȝ承图?br />     17. [Ctrl+Shift+B]
        讄断点或者取消断炏V?br />     18. [F11]
        调试最后一ơ运行的E序?br />     19. [Ctrl+F11]
        q行最后一ơ运行的E序?br />     20. [F5]
        debug时跟t到某一个方法中?br />     21. [F6]
        单步debug?br />     22. [F7]
        debug时[F7]?span style="font-size: 12pt; font-family: ?hu)? mso-bidi-font-family: ?hu)? mso-font-kerning: 0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">执行完方法,q回到调用此Ҏ(gu)的后一条语句?/span>
    23. [F8]
        debugӞ如果使用[F8]?span style="font-size: 12pt; font-family: ?hu)? mso-bidi-font-family: ?hu)? mso-font-kerning: 0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">l箋(hu)执行Q到下一个断Ҏ(gu)E序l束?br />
    24. [Ctrl+C][Ctrl+V][Ctrl+X][Ctrl+Z][Ctrl+S][Ctrl+F][Ctrl+Y
        复制Q粘_(d)剪切Q撤消,保存Q查找,重复?br />     25. [Ctrl+F6][Ctrl+Shift+F6][Ctrl+F7][Ctrl+Shift+F7][Ctrl+F8][Ctrl+Shift+F8]
        切换C一个编辑器,上一个编辑器Q?span style="font-size: 12pt; font-family: ?hu)? mso-bidi-font-family: ?hu)? mso-font-kerning: 0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">下一个视?/span>Q上一个视图,下一个透视图,上一个透视图?br />     26. [Ctrl+1]
        快速修正,很有用?br />     27. [Shift+F2]
        打开外部java文档?br />     28. [Ctrl+H]
        打开搜烦(ch)对话框?br />     29. [Alt+Shift+T][Alt+Shift+C][Alt+Shift+V][Alt+Shift+R]
        快速显C重构菜?重构-改变Ҏ(gu){֐,重构-Ud,重构-重命?/span>
    30. [Alt+Left/Right][Ctrl+Shift+Left/Right/Up/Down][Alt+Shift+Up/Down/Left/Right][Alt+Up/Down][Ctrl+Alt+Up/Down]
        上一?下一ơ光标所在位|?上一个单?下一个单?上一个成?span lang="EN-US">/下一个成员(成员对象或成员函敎ͼ(j)
,选中闭合元素,上下Ud选中的行,拯选中的行?/span>
    31. [Ctrl+Shift+Enter][Shift+Enter]
        在当前行上插入一行,在当前行下插入一行?br />     32. [End/Home][Ctrl+Right/Left][Ctrl+Up/Down][Shift+End/Home]
        行末/行首,前一?span lang="EN-US">/后一个单?/span>,上下滚屏,选中到行?span lang="EN-US">/行首
    33. [Ctrl+T][Ctrl+Alt+H]
        快速层ơ结构,打开调用层次l构?/span>
    34. [Ctrl+Q]
        上一个编辑的位置?br />     35. [Ctrl+Shift+S]
        保存所有?br />     36. [Ctrl+.]
        下一个命中的(搜烦(ch)之后Q?br />     37. [Ctrl+Shift+X/Y]
        变(sh)ؓ(f)?span lang="EN-US">/

            
  大家有好用的快捷键,可以一起分享?nbsp;@anthor ClumsyBird 



ClumsyBird 2010-11-11 00:11 发表评论
]]>
Windows下git下蝲android sourcehttp://www.aygfsteel.com/zhou-zhihao/archive/2010/11/11/337768.htmlClumsyBirdClumsyBirdWed, 10 Nov 2010 16:03:00 GMThttp://www.aygfsteel.com/zhou-zhihao/archive/2010/11/11/337768.htmlhttp://www.aygfsteel.com/zhou-zhihao/comments/337768.htmlhttp://www.aygfsteel.com/zhou-zhihao/archive/2010/11/11/337768.html#Feedback0http://www.aygfsteel.com/zhou-zhihao/comments/commentRss/337768.htmlhttp://www.aygfsteel.com/zhou-zhihao/services/trackbacks/337768.html一 安装git
    http://code.google.com/p/msysgit/downloads/list下蝲Q安装即可?br />
?
android代码仓库
    http://android.git.kernel.org 可以看到android所有git包的列表?br />
?下蝲android source
    在windows下创建目录android srcQ右击选择Git Bush,输入git clone git://android.git.kernel.org/platform/external/v8.gitQ即可下?span class="Apple-style-span" style="word-spacing: 0px; font: 12px Simsun; text-transform: none; color: rgb(0,0,0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">external/v8下的源代?其他的源码下载以此类推?br />
?命o(h)解释
    git clone是命?/span>Q?span class="Apple-style-span" style="word-spacing: 0px; font: 12px Simsun; text-transform: none; color: rgb(0,0,0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">git://android.git.kernel.org/platform/external/v8.gitQ可以选择git包列表的一,点击q入Q在http://android.git.kernel.org 中可以看到?br />
@anthor ClumsyBird



ClumsyBird 2010-11-11 00:03 发表评论
]]>
վ֩ģ壺 ԭ| | | | | | ɽ| | | | | ˮ| | | ƴ| ½| | | ũ| | ȫ| | | | ׿| | | ʳ| ̽| Ұ| ߰| | ̷| | Ժ| Ȫ| | ƽ| ̨| տ| ʯׯ|