﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-CPlusPlus Programming</title><link>http://www.cppblog.com/DGQKing/</link><description /><language>zh-cn</language><lastBuildDate>Mon, 06 Apr 2026 22:30:32 GMT</lastBuildDate><pubDate>Mon, 06 Apr 2026 22:30:32 GMT</pubDate><ttl>60</ttl><item><title>Animate</title><link>http://www.cppblog.com/DGQKing/archive/2012/05/18/175335.html</link><dc:creator>DGQKing</dc:creator><author>DGQKing</author><pubDate>Fri, 18 May 2012 13:48:00 GMT</pubDate><guid>http://www.cppblog.com/DGQKing/archive/2012/05/18/175335.html</guid><wfw:comment>http://www.cppblog.com/DGQKing/comments/175335.html</wfw:comment><comments>http://www.cppblog.com/DGQKing/archive/2012/05/18/175335.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/DGQKing/comments/commentRss/175335.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/DGQKing/services/trackbacks/175335.html</trackback:ping><description><![CDATA[<p>/*浙江工业大学 1017<br />Animate <br />Time Limit:1000MS&nbsp; Memory Limit:32768K</p>
<p><br />Description:<br />Have you ever Googled the &#8220;Animate&#8221;?Tyr Googles the &#8220;Animate&#8221; one day, and find out 245 match records.<br />But he don&#8217;t know whether the number 245 is correct or not. Here comes the problem A: Give you a <br />documentation,your task is to find out whether this documentation contains the word &#8220;Animate&#8221; or not. </p>
<p>Input:<br />The input will consist of several case of input.The first line is an integer N which give the case number.<br />The next part has N cases.Every case follows this format: Line 1: The beginning of the documentation: #Doc <br />Line 2 to m-1: The contest of documentation,this may be consists of several lines.Every line contains less <br />than 100 characters,and the total characters of one documentation is less than 1000. Line m:The end of the <br />documentation:#End <br />Output:<br />For each input case,your program should print an anwser in a single line.If the documentation contains <br />&#8220;Animate&#8221;, please print &#8220;Yes&#8221;, else print &#8220;No&#8221;. In Google, we know the match is case insensitive,<br />which means &#8220;animate&#8221; is also a match of &#8220;Animate&#8221;. In this problem we just take care of the alphabet <br />characters, please ignore other characters. </p>
<p>*/<br />&nbsp;&nbsp;&nbsp; 最开始，这道题我一看，非常容易可以用字符串string类的查找方法，如是写了如下的一个程序：</p>
<div style="border-bottom: #cccccc 1px solid; border-left: #cccccc 1px solid; padding-bottom: 4px; background-color: #eeeeee; padding-left: 4px; width: 98%; padding-right: 5px; font-size: 13px; word-break: break-all; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; padding-top: 4px"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /><span style="color: #000000">#include</span><span style="color: #000000">&lt;</span><span style="color: #000000">iostream</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />#include</span><span style="color: #000000">&lt;</span><span style="color: #0000ff">string</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /></span><span style="color: #0000ff">using</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">namespace</span><span style="color: #000000">&nbsp;std;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /><br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /></span><span style="color: #0000ff">int</span><span style="color: #000000">&nbsp;main()<br /><img id="Codehighlighter1_69_424_Open_Image" onclick="this.style.display='none'; Codehighlighter1_69_424_Open_Text.style.display='none'; Codehighlighter1_69_424_Closed_Image.style.display='inline'; Codehighlighter1_69_424_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockStart.gif"><img style="display: none" id="Codehighlighter1_69_424_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_69_424_Closed_Text.style.display='none'; Codehighlighter1_69_424_Open_Image.style.display='inline'; Codehighlighter1_69_424_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedBlock.gif"></span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_69_424_Closed_Text"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_69_424_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">char</span><span style="color: #000000">&nbsp;tmp[</span><span style="color: #000000">101</span><span style="color: #000000">];<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">string</span><span style="color: #000000">&nbsp;str;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">int</span><span style="color: #000000">&nbsp;N;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;scanf(</span><span style="color: #000000">"</span><span style="color: #000000">%d%*c</span><span style="color: #000000">"</span><span style="color: #000000">,</span><span style="color: #000000">&amp;</span><span style="color: #000000">N);<br /><img id="Codehighlighter1_139_411_Open_Image" onclick="this.style.display='none'; Codehighlighter1_139_411_Open_Text.style.display='none'; Codehighlighter1_139_411_Closed_Image.style.display='inline'; Codehighlighter1_139_411_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_139_411_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_139_411_Closed_Text.style.display='none'; Codehighlighter1_139_411_Open_Image.style.display='inline'; Codehighlighter1_139_411_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">while</span><span style="color: #000000">(N</span><span style="color: #000000">--</span><span style="color: #000000">)</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_139_411_Closed_Text"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_139_411_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">bool</span><span style="color: #000000">&nbsp;flag&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">false</span><span style="color: #000000">;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gets(tmp);<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;str&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;tmp;<br /><img id="Codehighlighter1_208_340_Open_Image" onclick="this.style.display='none'; Codehighlighter1_208_340_Open_Text.style.display='none'; Codehighlighter1_208_340_Closed_Image.style.display='inline'; Codehighlighter1_208_340_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_208_340_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_208_340_Closed_Text.style.display='none'; Codehighlighter1_208_340_Open_Image.style.display='inline'; Codehighlighter1_208_340_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">while</span><span style="color: #000000">(str</span><span style="color: #000000">!=</span><span style="color: #000000">"</span><span style="color: #000000">#END</span><span style="color: #000000">"</span><span style="color: #000000">)</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_208_340_Closed_Text"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_208_340_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gets(tmp);<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strupr(tmp);<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;str&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;tmp;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">cout&lt;&lt;str&lt;&lt;endl;</span><span style="color: #008000"><br /><img id="Codehighlighter1_314_336_Open_Image" onclick="this.style.display='none'; Codehighlighter1_314_336_Open_Text.style.display='none'; Codehighlighter1_314_336_Closed_Image.style.display='inline'; Codehighlighter1_314_336_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_314_336_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_314_336_Closed_Text.style.display='none'; Codehighlighter1_314_336_Open_Image.style.display='inline'; Codehighlighter1_314_336_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif"></span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">(str.find(</span><span style="color: #000000">"</span><span style="color: #000000">ANIMATE</span><span style="color: #000000">"</span><span style="color: #000000">)</span><span style="color: #000000">!=</span><span style="color: #000000">4294967295</span><span style="color: #000000">)</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_314_336_Closed_Text"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_314_336_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;flag&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">true</span><span style="color: #000000">;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /><img id="Codehighlighter1_352_378_Open_Image" onclick="this.style.display='none'; Codehighlighter1_352_378_Open_Text.style.display='none'; Codehighlighter1_352_378_Closed_Image.style.display='inline'; Codehighlighter1_352_378_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_352_378_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_352_378_Closed_Text.style.display='none'; Codehighlighter1_352_378_Open_Image.style.display='inline'; Codehighlighter1_352_378_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">(flag)</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_352_378_Closed_Text"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_352_378_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cout</span><span style="color: #000000">&lt;&lt;</span><span style="color: #000000">"</span><span style="color: #000000">Yes</span><span style="color: #000000">"</span><span style="color: #000000">&lt;&lt;</span><span style="color: #000000">endl;<br /><img id="Codehighlighter1_383_408_Open_Image" onclick="this.style.display='none'; Codehighlighter1_383_408_Open_Text.style.display='none'; Codehighlighter1_383_408_Closed_Image.style.display='inline'; Codehighlighter1_383_408_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_383_408_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_383_408_Closed_Text.style.display='none'; Codehighlighter1_383_408_Open_Image.style.display='inline'; Codehighlighter1_383_408_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #0000ff">else</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_383_408_Closed_Text"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_383_408_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cout</span><span style="color: #000000">&lt;&lt;</span><span style="color: #000000">"</span><span style="color: #000000">No</span><span style="color: #000000">"</span><span style="color: #000000">&lt;&lt;</span><span style="color: #000000">endl;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">return</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">0</span><span style="color: #000000">;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockEnd.gif"  alt="" />}</span></span></div>
<p>&nbsp;&nbsp;&nbsp; 结果提交的结果，为wrong answear，百思不得其解，如是在网上搜了一下，发现题目的最后一句话：只考虑字母的情况！！这句话才是解这道题目的关键。正确的代码如下所示：</p>
<div style="border-bottom: #cccccc 1px solid; border-left: #cccccc 1px solid; padding-bottom: 4px; background-color: #eeeeee; padding-left: 4px; width: 98%; padding-right: 5px; font-size: 13px; word-break: break-all; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; padding-top: 4px"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /><span style="color: #000000">#include</span><span style="color: #000000">&lt;</span><span style="color: #000000">iostream</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />#include</span><span style="color: #000000">&lt;</span><span style="color: #000000">fstream</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" />#include</span><span style="color: #000000">&lt;</span><span style="color: #000000">sstream</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /></span><span style="color: #0000ff">using</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">namespace</span><span style="color: #000000">&nbsp;std;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /></span><span style="color: #008000">//</span><span style="color: #008000">-----------------------------------</span><span style="color: #008000"><br /><img id="Codehighlighter1_124_519_Open_Image" onclick="this.style.display='none'; Codehighlighter1_124_519_Open_Text.style.display='none'; Codehighlighter1_124_519_Closed_Image.style.display='inline'; Codehighlighter1_124_519_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockStart.gif"><img style="display: none" id="Codehighlighter1_124_519_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_124_519_Closed_Text.style.display='none'; Codehighlighter1_124_519_Open_Image.style.display='inline'; Codehighlighter1_124_519_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedBlock.gif"></span><span style="color: #0000ff">int</span><span style="color: #000000">&nbsp;main()</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_124_519_Closed_Text"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_124_519_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">int</span><span style="color: #000000">&nbsp;a;cin</span><span style="color: #000000">&gt;&gt;</span><span style="color: #000000">a;<br /><img id="Codehighlighter1_162_517_Open_Image" onclick="this.style.display='none'; Codehighlighter1_162_517_Open_Text.style.display='none'; Codehighlighter1_162_517_Closed_Image.style.display='inline'; Codehighlighter1_162_517_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_162_517_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_162_517_Closed_Text.style.display='none'; Codehighlighter1_162_517_Open_Image.style.display='inline'; Codehighlighter1_162_517_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">for</span><span style="color: #000000">(</span><span style="color: #0000ff">int</span><span style="color: #000000">&nbsp;i</span><span style="color: #000000">=</span><span style="color: #000000">0</span><span style="color: #000000">;i</span><span style="color: #000000">&lt;</span><span style="color: #000000">a;i</span><span style="color: #000000">++</span><span style="color: #000000">)</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_162_517_Closed_Text"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_162_517_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">bool</span><span style="color: #000000">&nbsp;isyes</span><span style="color: #000000">=</span><span style="color: #000000">0</span><span style="color: #000000">;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">string</span><span style="color: #000000">&nbsp;s;</span><span style="color: #0000ff">bool</span><span style="color: #000000">&nbsp;head</span><span style="color: #000000">=</span><span style="color: #000000">0</span><span style="color: #000000">;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">string</span><span style="color: #000000">&nbsp;s2</span><span style="color: #000000">=</span><span style="color: #000000">""</span><span style="color: #000000">;<br /><img id="Codehighlighter1_238_478_Open_Image" onclick="this.style.display='none'; Codehighlighter1_238_478_Open_Text.style.display='none'; Codehighlighter1_238_478_Closed_Image.style.display='inline'; Codehighlighter1_238_478_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_238_478_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_238_478_Closed_Text.style.display='none'; Codehighlighter1_238_478_Open_Image.style.display='inline'; Codehighlighter1_238_478_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">while</span><span style="color: #000000">(s</span><span style="color: #000000">!=</span><span style="color: #000000">"</span><span style="color: #000000">#End</span><span style="color: #000000">"</span><span style="color: #000000">)</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_238_478_Closed_Text"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_238_478_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;getline(cin,s);<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">(s</span><span style="color: #000000">==</span><span style="color: #000000">"</span><span style="color: #000000">#Doc</span><span style="color: #000000">"</span><span style="color: #000000">)<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;head</span><span style="color: #000000">=</span><span style="color: #000000">1</span><span style="color: #000000">;<br /><img id="Codehighlighter1_299_474_Open_Image" onclick="this.style.display='none'; Codehighlighter1_299_474_Open_Text.style.display='none'; Codehighlighter1_299_474_Closed_Image.style.display='inline'; Codehighlighter1_299_474_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_299_474_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_299_474_Closed_Text.style.display='none'; Codehighlighter1_299_474_Open_Image.style.display='inline'; Codehighlighter1_299_474_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">(head)</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_299_474_Closed_Text"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_299_474_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">for</span><span style="color: #000000">(</span><span style="color: #0000ff">int</span><span style="color: #000000">&nbsp;i</span><span style="color: #000000">=</span><span style="color: #000000">0</span><span style="color: #000000">;i</span><span style="color: #000000">&lt;</span><span style="color: #000000">s.length();i</span><span style="color: #000000">++</span><span style="color: #000000">)<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">(isalpha(s[i]))<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s2</span><span style="color: #000000">+=</span><span style="color: #000000">tolower(s[i]);<br /><img id="Codehighlighter1_425_469_Open_Image" onclick="this.style.display='none'; Codehighlighter1_425_469_Open_Text.style.display='none'; Codehighlighter1_425_469_Closed_Image.style.display='inline'; Codehighlighter1_425_469_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_425_469_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_425_469_Closed_Text.style.display='none'; Codehighlighter1_425_469_Open_Image.style.display='inline'; Codehighlighter1_425_469_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">(s2.find(</span><span style="color: #000000">"</span><span style="color: #000000">animate</span><span style="color: #000000">"</span><span style="color: #000000">)</span><span style="color: #000000">!=-</span><span style="color: #000000">1</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">&amp;&amp;</span><span style="color: #000000">&nbsp;isyes</span><span style="color: #000000">==</span><span style="color: #000000">0</span><span style="color: #000000">)</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_425_469_Closed_Text"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_425_469_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cout</span><span style="color: #000000">&lt;&lt;</span><span style="color: #000000">"</span><span style="color: #000000">Yes</span><span style="color: #000000">"</span><span style="color: #000000">&lt;&lt;</span><span style="color: #000000">endl;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;isyes</span><span style="color: #000000">=</span><span style="color: #000000">1</span><span style="color: #000000">;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">(isyes</span><span style="color: #000000">==</span><span style="color: #000000">0</span><span style="color: #000000">)<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cout</span><span style="color: #000000">&lt;&lt;</span><span style="color: #000000">"</span><span style="color: #000000">No</span><span style="color: #000000">"</span><span style="color: #000000">&lt;&lt;</span><span style="color: #000000">endl;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockEnd.gif"  alt="" />}</span></span></div>
<p><br /><br />&nbsp;</p><img src ="http://www.cppblog.com/DGQKing/aggbug/175335.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/DGQKing/" target="_blank">DGQKing</a> 2012-05-18 21:48 <a href="http://www.cppblog.com/DGQKing/archive/2012/05/18/175335.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Sum It Up</title><link>http://www.cppblog.com/DGQKing/archive/2012/05/07/173891.html</link><dc:creator>DGQKing</dc:creator><author>DGQKing</author><pubDate>Mon, 07 May 2012 04:48:00 GMT</pubDate><guid>http://www.cppblog.com/DGQKing/archive/2012/05/07/173891.html</guid><wfw:comment>http://www.cppblog.com/DGQKing/comments/173891.html</wfw:comment><comments>http://www.cppblog.com/DGQKing/archive/2012/05/07/173891.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/DGQKing/comments/commentRss/173891.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/DGQKing/services/trackbacks/173891.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: /*浙江工业大学1100Sum It Up Time Limit:1000MS&nbsp; Memory Limit:32768KDescription:Given a specified total t and a list of n integers, find all distinct sums using numbers from the list that add up to t. ...&nbsp;&nbsp;<a href='http://www.cppblog.com/DGQKing/archive/2012/05/07/173891.html'>阅读全文</a><img src ="http://www.cppblog.com/DGQKing/aggbug/173891.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/DGQKing/" target="_blank">DGQKing</a> 2012-05-07 12:48 <a href="http://www.cppblog.com/DGQKing/archive/2012/05/07/173891.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>整数次幂取模</title><link>http://www.cppblog.com/DGQKing/archive/2011/11/10/159930.html</link><dc:creator>DGQKing</dc:creator><author>DGQKing</author><pubDate>Thu, 10 Nov 2011 08:59:00 GMT</pubDate><guid>http://www.cppblog.com/DGQKing/archive/2011/11/10/159930.html</guid><wfw:comment>http://www.cppblog.com/DGQKing/comments/159930.html</wfw:comment><comments>http://www.cppblog.com/DGQKing/archive/2011/11/10/159930.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/DGQKing/comments/commentRss/159930.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/DGQKing/services/trackbacks/159930.html</trackback:ping><description><![CDATA[<p>浙江工业大学1052<br />整数次幂取模 <br />Time Limit:1000MS&nbsp; Memory Limit:32768K</p>
<p><br />Description:<br />给定一个数，其值用A的B次方表示(B&lt;100000)，求该数除以一个整数C（&lt;100000）所得的余数。注意算法的合理性，其性能有一定的要求。每行有三个数，依次表示A，B，C，每行对输出对应的余数。 </p>
<p>Sample Input:<br />1 2 3<br />2 1 3<br />3 3 5<br />Sample Output:<br />1<br />2<br />2</p>源代码：
<div style="border-bottom: #cccccc 1px solid; border-left: #cccccc 1px solid; padding-bottom: 4px; background-color: #eeeeee; padding-left: 4px; width: 98%; padding-right: 5px; font-size: 13px; word-break: break-all; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; padding-top: 4px"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /><span style="color: #000000">#include</span><span style="color: #000000">&lt;</span><span style="color: #000000">iostream</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /></span><span style="color: #0000ff">using</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">namespace</span><span style="color: #000000">&nbsp;std;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /><br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /></span><span style="color: #0000ff">long</span><span style="color: #000000">&nbsp;power(</span><span style="color: #0000ff">long</span><span style="color: #000000">&nbsp;A,</span><span style="color: #0000ff">long</span><span style="color: #000000">&nbsp;B,</span><span style="color: #0000ff">long</span><span style="color: #000000">&nbsp;C)<br /><img id="Codehighlighter1_74_250_Open_Image" onclick="this.style.display='none'; Codehighlighter1_74_250_Open_Text.style.display='none'; Codehighlighter1_74_250_Closed_Image.style.display='inline'; Codehighlighter1_74_250_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockStart.gif"><img style="display: none" id="Codehighlighter1_74_250_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_74_250_Closed_Text.style.display='none'; Codehighlighter1_74_250_Open_Image.style.display='inline'; Codehighlighter1_74_250_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedBlock.gif"></span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_74_250_Closed_Text"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_74_250_Open_Text"><span style="color: #000000">{<br /><img id="Codehighlighter1_85_100_Open_Image" onclick="this.style.display='none'; Codehighlighter1_85_100_Open_Text.style.display='none'; Codehighlighter1_85_100_Closed_Image.style.display='inline'; Codehighlighter1_85_100_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_85_100_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_85_100_Closed_Text.style.display='none'; Codehighlighter1_85_100_Open_Image.style.display='inline'; Codehighlighter1_85_100_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">(B</span><span style="color: #000000">==</span><span style="color: #000000">0</span><span style="color: #000000">)</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_85_100_Closed_Text"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_85_100_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">return</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">1</span><span style="color: #000000">;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /><img id="Codehighlighter1_111_128_Open_Image" onclick="this.style.display='none'; Codehighlighter1_111_128_Open_Text.style.display='none'; Codehighlighter1_111_128_Closed_Image.style.display='inline'; Codehighlighter1_111_128_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_111_128_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_111_128_Closed_Text.style.display='none'; Codehighlighter1_111_128_Open_Image.style.display='inline'; Codehighlighter1_111_128_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">(B</span><span style="color: #000000">==</span><span style="color: #000000">1</span><span style="color: #000000">)</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_111_128_Closed_Text"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_111_128_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">return</span><span style="color: #000000">&nbsp;A</span><span style="color: #000000">%</span><span style="color: #000000">C;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" /><br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">long</span><span style="color: #000000">&nbsp;tmp&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;power(A,B</span><span style="color: #000000">/</span><span style="color: #000000">2</span><span style="color: #000000">,C);<br /><img id="Codehighlighter1_170_207_Open_Image" onclick="this.style.display='none'; Codehighlighter1_170_207_Open_Text.style.display='none'; Codehighlighter1_170_207_Closed_Image.style.display='inline'; Codehighlighter1_170_207_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_170_207_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_170_207_Closed_Text.style.display='none'; Codehighlighter1_170_207_Open_Image.style.display='inline'; Codehighlighter1_170_207_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">(B</span><span style="color: #000000">&amp;</span><span style="color: #000000">1</span><span style="color: #000000">==</span><span style="color: #000000">1</span><span style="color: #000000">)</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_170_207_Closed_Text"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_170_207_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">return</span><span style="color: #000000">&nbsp;(((tmp</span><span style="color: #000000">*</span><span style="color: #000000">tmp)</span><span style="color: #000000">%</span><span style="color: #000000">C)</span><span style="color: #000000">*</span><span style="color: #000000">(A</span><span style="color: #000000">%</span><span style="color: #000000">C))</span><span style="color: #000000">%</span><span style="color: #000000">C;<br /><img id="Codehighlighter1_212_237_Open_Image" onclick="this.style.display='none'; Codehighlighter1_212_237_Open_Text.style.display='none'; Codehighlighter1_212_237_Closed_Image.style.display='inline'; Codehighlighter1_212_237_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_212_237_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_212_237_Closed_Text.style.display='none'; Codehighlighter1_212_237_Open_Image.style.display='inline'; Codehighlighter1_212_237_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #0000ff">else</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_212_237_Closed_Text"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_212_237_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">return</span><span style="color: #000000">&nbsp;(tmp</span><span style="color: #000000">*</span><span style="color: #000000">tmp)</span><span style="color: #000000">%</span><span style="color: #000000">C;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">return</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">0</span><span style="color: #000000">;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockEnd.gif"  alt="" />}</span></span><span style="color: #000000"><br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /><br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /></span><span style="color: #0000ff">int</span><span style="color: #000000">&nbsp;main()<br /><img id="Codehighlighter1_264_368_Open_Image" onclick="this.style.display='none'; Codehighlighter1_264_368_Open_Text.style.display='none'; Codehighlighter1_264_368_Closed_Image.style.display='inline'; Codehighlighter1_264_368_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockStart.gif"><img style="display: none" id="Codehighlighter1_264_368_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_264_368_Closed_Text.style.display='none'; Codehighlighter1_264_368_Open_Image.style.display='inline'; Codehighlighter1_264_368_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedBlock.gif"></span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_264_368_Closed_Text"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_264_368_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">long</span><span style="color: #000000">&nbsp;A,B,C;<br /><img id="Codehighlighter1_319_355_Open_Image" onclick="this.style.display='none'; Codehighlighter1_319_355_Open_Text.style.display='none'; Codehighlighter1_319_355_Closed_Image.style.display='inline'; Codehighlighter1_319_355_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_319_355_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_319_355_Closed_Text.style.display='none'; Codehighlighter1_319_355_Open_Image.style.display='inline'; Codehighlighter1_319_355_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">while</span><span style="color: #000000">(scanf(</span><span style="color: #000000">"</span><span style="color: #000000">%ld%ld%ld</span><span style="color: #000000">"</span><span style="color: #000000">,</span><span style="color: #000000">&amp;</span><span style="color: #000000">A,</span><span style="color: #000000">&amp;</span><span style="color: #000000">B,</span><span style="color: #000000">&amp;</span><span style="color: #000000">C)</span><span style="color: #000000">!=</span><span style="color: #000000">EOF)</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_319_355_Closed_Text"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_319_355_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf(</span><span style="color: #000000">"</span><span style="color: #000000">%ld\n</span><span style="color: #000000">"</span><span style="color: #000000">,power(A,B,C));<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">return</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">0</span><span style="color: #000000">;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockEnd.gif"  alt="" />}</span></span><span style="color: #000000"><br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /><br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /><br /><img id="Codehighlighter1_372_641_Open_Image" onclick="this.style.display='none'; Codehighlighter1_372_641_Open_Text.style.display='none'; Codehighlighter1_372_641_Closed_Image.style.display='inline'; Codehighlighter1_372_641_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockStart.gif"><img style="display: none" id="Codehighlighter1_372_641_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_372_641_Closed_Text.style.display='none'; Codehighlighter1_372_641_Open_Image.style.display='inline'; Codehighlighter1_372_641_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedBlock.gif"></span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_372_641_Closed_Text">/**/</span><span id="Codehighlighter1_372_641_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">long&nbsp;long&nbsp;PowerMod(long&nbsp;long&nbsp;a,&nbsp;int&nbsp;b,&nbsp;int&nbsp;k)&nbsp;&nbsp;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />{&nbsp;&nbsp;&nbsp;//(a^b&nbsp;)%k&nbsp;&nbsp;&nbsp;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;long&nbsp;long&nbsp;tmp&nbsp;=&nbsp;a,&nbsp;ret&nbsp;=&nbsp;1;&nbsp;&nbsp;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;for(;&nbsp;b&nbsp;;&nbsp;b&gt;&gt;1&nbsp;)&nbsp;&nbsp;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(b&nbsp;&amp;&nbsp;1)&nbsp;&nbsp;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ret&nbsp;=&nbsp;(ret&nbsp;*&nbsp;tmp)&nbsp;%&nbsp;k;&nbsp;&nbsp;//只是每步运算的时候都取模&nbsp;&nbsp;&nbsp;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tmp&nbsp;=&nbsp;(tmp&nbsp;*&nbsp;tmp)&nbsp;%&nbsp;k;&nbsp;&nbsp;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;ret;&nbsp;&nbsp;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockEnd.gif"  alt="" />}</span><span style="color: #008000">*/</span></span></div><br /><br /><br /><img src ="http://www.cppblog.com/DGQKing/aggbug/159930.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/DGQKing/" target="_blank">DGQKing</a> 2011-11-10 16:59 <a href="http://www.cppblog.com/DGQKing/archive/2011/11/10/159930.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>折纸游戏</title><link>http://www.cppblog.com/DGQKing/archive/2011/11/10/159924.html</link><dc:creator>DGQKing</dc:creator><author>DGQKing</author><pubDate>Thu, 10 Nov 2011 08:16:00 GMT</pubDate><guid>http://www.cppblog.com/DGQKing/archive/2011/11/10/159924.html</guid><wfw:comment>http://www.cppblog.com/DGQKing/comments/159924.html</wfw:comment><comments>http://www.cppblog.com/DGQKing/archive/2011/11/10/159924.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/DGQKing/comments/commentRss/159924.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/DGQKing/services/trackbacks/159924.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: /*浙江工业大学1016折纸游戏 Time Limit:1000MS&nbsp; Memory Limit:32768KDescription:fans喜欢玩折纸游戏。整张纸被分成m*m个格子，即构成一个方阵，每个格子里面都写了一个正整数。游戏分两步：首先左右对折，如果对应的格子的数字都相同，那么进行下一步操作；否则停止游戏，此时游戏的结果是&#8220;no&#8221;。然后上下对折，如果...&nbsp;&nbsp;<a href='http://www.cppblog.com/DGQKing/archive/2011/11/10/159924.html'>阅读全文</a><img src ="http://www.cppblog.com/DGQKing/aggbug/159924.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/DGQKing/" target="_blank">DGQKing</a> 2011-11-10 16:16 <a href="http://www.cppblog.com/DGQKing/archive/2011/11/10/159924.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>简单的事情</title><link>http://www.cppblog.com/DGQKing/archive/2011/11/10/159922.html</link><dc:creator>DGQKing</dc:creator><author>DGQKing</author><pubDate>Thu, 10 Nov 2011 07:48:00 GMT</pubDate><guid>http://www.cppblog.com/DGQKing/archive/2011/11/10/159922.html</guid><wfw:comment>http://www.cppblog.com/DGQKing/comments/159922.html</wfw:comment><comments>http://www.cppblog.com/DGQKing/archive/2011/11/10/159922.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/DGQKing/comments/commentRss/159922.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/DGQKing/services/trackbacks/159922.html</trackback:ping><description><![CDATA[题目描述：<br />
<p>简单的事情 <br />Time Limit:1000MS&nbsp; Memory Limit:32768K</p>
<p><br />Description:<br />数学天才fans曾经说过一句话：组合数的计算是一件非常简单的事情。组合数的计算真的是一件非常简单的事情吗？请你自己去尝试一下吧！ </p>
<p>Input:<br />输入中的一些整数对n，m（m&#8804;n&#8804;20） <br />Output:<br />输出其组合数。 <br />Sample Input:<br />5 2<br />18 13<br />Sample Output:<br />10<br />8568</p><br />解题思路：c[n][m] = c[n-1][m-1]+c[n-1][m];<br /><br />源代码： 
<div style="border-bottom: #cccccc 1px solid; border-left: #cccccc 1px solid; padding-bottom: 4px; background-color: #eeeeee; padding-left: 4px; width: 98%; padding-right: 5px; font-size: 13px; word-break: break-all; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; padding-top: 4px"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /><span style="color: #000000">#include</span><span style="color: #000000">&lt;</span><span style="color: #000000">iostream</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /></span><span style="color: #0000ff">using</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">namespace</span><span style="color: #000000">&nbsp;std;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /><br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /></span><span style="color: #0000ff">int</span><span style="color: #000000">&nbsp;c[</span><span style="color: #000000">21</span><span style="color: #000000">][</span><span style="color: #000000">21</span><span style="color: #000000">];<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /><br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif"  alt="" /></span><span style="color: #0000ff">int</span><span style="color: #000000">&nbsp;main()<br /><img id="Codehighlighter1_68_334_Open_Image" onclick="this.style.display='none'; Codehighlighter1_68_334_Open_Text.style.display='none'; Codehighlighter1_68_334_Closed_Image.style.display='inline'; Codehighlighter1_68_334_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockStart.gif"><img style="display: none" id="Codehighlighter1_68_334_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_68_334_Closed_Text.style.display='none'; Codehighlighter1_68_334_Open_Image.style.display='inline'; Codehighlighter1_68_334_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedBlock.gif"></span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_68_334_Closed_Text"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_68_334_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">int</span><span style="color: #000000">&nbsp;n,m;<br /><img id="Codehighlighter1_103_121_Open_Image" onclick="this.style.display='none'; Codehighlighter1_103_121_Open_Text.style.display='none'; Codehighlighter1_103_121_Closed_Image.style.display='inline'; Codehighlighter1_103_121_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_103_121_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_103_121_Closed_Text.style.display='none'; Codehighlighter1_103_121_Open_Image.style.display='inline'; Codehighlighter1_103_121_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">for</span><span style="color: #000000">(</span><span style="color: #0000ff">int</span><span style="color: #000000">&nbsp;i</span><span style="color: #000000">=</span><span style="color: #000000">0</span><span style="color: #000000">;i</span><span style="color: #000000">&lt;=</span><span style="color: #000000">20</span><span style="color: #000000">;i</span><span style="color: #000000">++</span><span style="color: #000000">)</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_103_121_Closed_Text"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_103_121_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c[i][</span><span style="color: #000000">0</span><span style="color: #000000">]&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">1</span><span style="color: #000000">;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /><img id="Codehighlighter1_146_164_Open_Image" onclick="this.style.display='none'; Codehighlighter1_146_164_Open_Text.style.display='none'; Codehighlighter1_146_164_Closed_Image.style.display='inline'; Codehighlighter1_146_164_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_146_164_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_146_164_Closed_Text.style.display='none'; Codehighlighter1_146_164_Open_Image.style.display='inline'; Codehighlighter1_146_164_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">for</span><span style="color: #000000">(</span><span style="color: #0000ff">int</span><span style="color: #000000">&nbsp;i</span><span style="color: #000000">=</span><span style="color: #000000">1</span><span style="color: #000000">;i</span><span style="color: #000000">&lt;=</span><span style="color: #000000">20</span><span style="color: #000000">;i</span><span style="color: #000000">++</span><span style="color: #000000">)</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_146_164_Closed_Text"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_146_164_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c[i][i]&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">1</span><span style="color: #000000">;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /><img id="Codehighlighter1_189_256_Open_Image" onclick="this.style.display='none'; Codehighlighter1_189_256_Open_Text.style.display='none'; Codehighlighter1_189_256_Closed_Image.style.display='inline'; Codehighlighter1_189_256_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_189_256_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_189_256_Closed_Text.style.display='none'; Codehighlighter1_189_256_Open_Image.style.display='inline'; Codehighlighter1_189_256_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">for</span><span style="color: #000000">(</span><span style="color: #0000ff">int</span><span style="color: #000000">&nbsp;i</span><span style="color: #000000">=</span><span style="color: #000000">2</span><span style="color: #000000">;i</span><span style="color: #000000">&lt;=</span><span style="color: #000000">20</span><span style="color: #000000">;i</span><span style="color: #000000">++</span><span style="color: #000000">)</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_189_256_Closed_Text"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_189_256_Open_Text"><span style="color: #000000">{<br /><img id="Codehighlighter1_213_253_Open_Image" onclick="this.style.display='none'; Codehighlighter1_213_253_Open_Text.style.display='none'; Codehighlighter1_213_253_Closed_Image.style.display='inline'; Codehighlighter1_213_253_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_213_253_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_213_253_Closed_Text.style.display='none'; Codehighlighter1_213_253_Open_Image.style.display='inline'; Codehighlighter1_213_253_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">for</span><span style="color: #000000">(</span><span style="color: #0000ff">int</span><span style="color: #000000">&nbsp;j</span><span style="color: #000000">=</span><span style="color: #000000">1</span><span style="color: #000000">;j</span><span style="color: #000000">&lt;</span><span style="color: #000000">i;j</span><span style="color: #000000">++</span><span style="color: #000000">)</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_213_253_Closed_Text"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_213_253_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c[i][j]&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;c[i</span><span style="color: #000000">-</span><span style="color: #000000">1</span><span style="color: #000000">][j</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">c[i</span><span style="color: #000000">-</span><span style="color: #000000">1</span><span style="color: #000000">][j];<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" /><br /><img id="Codehighlighter1_291_321_Open_Image" onclick="this.style.display='none'; Codehighlighter1_291_321_Open_Text.style.display='none'; Codehighlighter1_291_321_Closed_Image.style.display='inline'; Codehighlighter1_291_321_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_291_321_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_291_321_Closed_Text.style.display='none'; Codehighlighter1_291_321_Open_Image.style.display='inline'; Codehighlighter1_291_321_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">while</span><span style="color: #000000">(scanf(</span><span style="color: #000000">"</span><span style="color: #000000">%d%d</span><span style="color: #000000">"</span><span style="color: #000000">,</span><span style="color: #000000">&amp;</span><span style="color: #000000">n,</span><span style="color: #000000">&amp;</span><span style="color: #000000">m)</span><span style="color: #000000">!=</span><span style="color: #000000">EOF)</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_291_321_Closed_Text"><img src="http://www.cppblog.com/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_291_321_Open_Text"><span style="color: #000000">{<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf(</span><span style="color: #000000">"</span><span style="color: #000000">%d\n</span><span style="color: #000000">"</span><span style="color: #000000">,c[n][m]);<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">return</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">0</span><span style="color: #000000">;<br /><img align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockEnd.gif"  alt="" />}</span></span></div><br /><br /><img src ="http://www.cppblog.com/DGQKing/aggbug/159922.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/DGQKing/" target="_blank">DGQKing</a> 2011-11-10 15:48 <a href="http://www.cppblog.com/DGQKing/archive/2011/11/10/159922.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>C库函数</title><link>http://www.cppblog.com/DGQKing/archive/2011/10/05/157548.html</link><dc:creator>DGQKing</dc:creator><author>DGQKing</author><pubDate>Wed, 05 Oct 2011 02:32:00 GMT</pubDate><guid>http://www.cppblog.com/DGQKing/archive/2011/10/05/157548.html</guid><wfw:comment>http://www.cppblog.com/DGQKing/comments/157548.html</wfw:comment><comments>http://www.cppblog.com/DGQKing/archive/2011/10/05/157548.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/DGQKing/comments/commentRss/157548.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/DGQKing/services/trackbacks/157548.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: C库函数手册(2007-6-17 15:40:00)分类函数,所在函数库为ctype.hint isalpha(int ch)&nbsp; 若ch是字母('A'-'Z','a'-'z')返回非0值,否则返回0int isalnum(int ch)&nbsp; 若ch是字母('A'-'Z','a'-'z')或数字('0'-'9')&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&...&nbsp;&nbsp;<a href='http://www.cppblog.com/DGQKing/archive/2011/10/05/157548.html'>阅读全文</a><img src ="http://www.cppblog.com/DGQKing/aggbug/157548.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/DGQKing/" target="_blank">DGQKing</a> 2011-10-05 10:32 <a href="http://www.cppblog.com/DGQKing/archive/2011/10/05/157548.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>