﻿<?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++博客-民工也疯狂</title><link>http://www.cppblog.com/xdu010/</link><description /><language>zh-cn</language><lastBuildDate>Mon, 13 Apr 2026 09:39:28 GMT</lastBuildDate><pubDate>Mon, 13 Apr 2026 09:39:28 GMT</pubDate><ttl>60</ttl><item><title>pku1995</title><link>http://www.cppblog.com/xdu010/archive/2008/08/14/58800.html</link><dc:creator>OIO</dc:creator><author>OIO</author><pubDate>Wed, 13 Aug 2008 23:13:00 GMT</pubDate><guid>http://www.cppblog.com/xdu010/archive/2008/08/14/58800.html</guid><wfw:comment>http://www.cppblog.com/xdu010/comments/58800.html</wfw:comment><comments>http://www.cppblog.com/xdu010/archive/2008/08/14/58800.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/xdu010/comments/commentRss/58800.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/xdu010/services/trackbacks/58800.html</trackback:ping><description><![CDATA[<p>&nbsp;</p>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #000000">#include&nbsp;</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 src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" align=top></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 src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" align=top>&nbsp;<br><img src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&nbsp;main()<br><img id=Codehighlighter1_54_628_Open_Image onclick="this.style.display='none'; Codehighlighter1_54_628_Open_Text.style.display='none'; Codehighlighter1_54_628_Closed_Image.style.display='inline'; Codehighlighter1_54_628_Closed_Text.style.display='inline';" src="http://www.cppblog.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_54_628_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_54_628_Closed_Text.style.display='none'; Codehighlighter1_54_628_Open_Image.style.display='inline'; Codehighlighter1_54_628_Open_Text.style.display='inline';" src="http://www.cppblog.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_54_628_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.cppblog.com/Images/dot.gif"></span><span id=Codehighlighter1_54_628_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">long</span><span style="COLOR: #000000">&nbsp;z,&nbsp;m,&nbsp;h,&nbsp;a,&nbsp;b,&nbsp;tmp,e;<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;cin</span><span style="COLOR: #000000">&gt;&gt;</span><span style="COLOR: #000000">z;<br><img id=Codehighlighter1_115_606_Open_Image onclick="this.style.display='none'; Codehighlighter1_115_606_Open_Text.style.display='none'; Codehighlighter1_115_606_Closed_Image.style.display='inline'; Codehighlighter1_115_606_Closed_Text.style.display='inline';" src="http://www.cppblog.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_115_606_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_115_606_Closed_Text.style.display='none'; Codehighlighter1_115_606_Open_Image.style.display='inline'; Codehighlighter1_115_606_Open_Text.style.display='inline';" src="http://www.cppblog.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">while</span><span style="COLOR: #000000">&nbsp;(z</span><span style="COLOR: #000000">--</span><span style="COLOR: #000000">)&nbsp;</span><span id=Codehighlighter1_115_606_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.cppblog.com/Images/dot.gif"></span><span id=Codehighlighter1_115_606_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cin</span><span style="COLOR: #000000">&gt;&gt;</span><span style="COLOR: #000000">m</span><span style="COLOR: #000000">&gt;&gt;</span><span style="COLOR: #000000">h;<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tmp&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">&nbsp;(</span><span style="COLOR: #0000ff">long</span><span style="COLOR: #000000">&nbsp;i&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;&nbsp;i&nbsp;</span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">&nbsp;h;&nbsp;</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">i)&nbsp;<br><img id=Codehighlighter1_193_567_Open_Image onclick="this.style.display='none'; Codehighlighter1_193_567_Open_Text.style.display='none'; Codehighlighter1_193_567_Closed_Image.style.display='inline'; Codehighlighter1_193_567_Closed_Text.style.display='inline';" src="http://www.cppblog.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_193_567_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_193_567_Closed_Text.style.display='none'; Codehighlighter1_193_567_Open_Image.style.display='inline'; Codehighlighter1_193_567_Open_Text.style.display='inline';" src="http://www.cppblog.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_193_567_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.cppblog.com/Images/dot.gif"></span><span id=Codehighlighter1_193_567_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cin</span><span style="COLOR: #000000">&gt;&gt;</span><span style="COLOR: #000000">a</span><span style="COLOR: #000000">&gt;&gt;</span><span style="COLOR: #000000">b;<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;__int64&nbsp;d&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">;&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">long</span><span style="COLOR: #000000">&nbsp;nlen&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br><img id=Codehighlighter1_299_301_Open_Image onclick="this.style.display='none'; Codehighlighter1_299_301_Open_Text.style.display='none'; Codehighlighter1_299_301_Closed_Image.style.display='inline'; Codehighlighter1_299_301_Closed_Text.style.display='inline';" src="http://www.cppblog.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_299_301_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_299_301_Closed_Text.style.display='none'; Codehighlighter1_299_301_Open_Image.style.display='inline'; Codehighlighter1_299_301_Open_Text.style.display='inline';" src="http://www.cppblog.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">short</span><span style="COLOR: #000000">&nbsp;Bin[</span><span style="COLOR: #000000">34</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">=</span><span id=Codehighlighter1_299_301_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.cppblog.com/Images/dot.gif"></span><span id=Codehighlighter1_299_301_Open_Text><span style="COLOR: #000000">{</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">}</span></span><span style="COLOR: #000000">;<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">while</span><span style="COLOR: #000000">&nbsp;(b</span><span style="COLOR: #000000">%</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000">&nbsp;b)<br><img id=Codehighlighter1_327_368_Open_Image onclick="this.style.display='none'; Codehighlighter1_327_368_Open_Text.style.display='none'; Codehighlighter1_327_368_Closed_Image.style.display='inline'; Codehighlighter1_327_368_Closed_Text.style.display='inline';" src="http://www.cppblog.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_327_368_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_327_368_Closed_Text.style.display='none'; Codehighlighter1_327_368_Open_Image.style.display='inline'; Codehighlighter1_327_368_Open_Text.style.display='inline';" src="http://www.cppblog.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_327_368_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.cppblog.com/Images/dot.gif"></span><span id=Codehighlighter1_327_368_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Bin[nlen</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">]&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;b</span><span style="COLOR: #000000">%</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">;<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b&nbsp;</span><span style="COLOR: #000000">&gt;&gt;=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">;<br><img src="http://www.cppblog.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Bin[nlen]&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;b;<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;d</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">a;e</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">;<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">&nbsp;(</span><span style="COLOR: #0000ff">long</span><span style="COLOR: #000000">&nbsp;i&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;&nbsp;i&nbsp;</span><span style="COLOR: #000000">&lt;=</span><span style="COLOR: #000000">nlen;&nbsp;i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)&nbsp;<br><img id=Codehighlighter1_457_540_Open_Image onclick="this.style.display='none'; Codehighlighter1_457_540_Open_Text.style.display='none'; Codehighlighter1_457_540_Closed_Image.style.display='inline'; Codehighlighter1_457_540_Closed_Text.style.display='inline';" src="http://www.cppblog.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_457_540_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_457_540_Closed_Text.style.display='none'; Codehighlighter1_457_540_Open_Image.style.display='inline'; Codehighlighter1_457_540_Open_Text.style.display='inline';" src="http://www.cppblog.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_457_540_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.cppblog.com/Images/dot.gif"></span><span id=Codehighlighter1_457_540_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&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">&nbsp;(Bin[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 id=Codehighlighter1_489_518_Open_Image onclick="this.style.display='none'; Codehighlighter1_489_518_Open_Text.style.display='none'; Codehighlighter1_489_518_Closed_Image.style.display='inline'; Codehighlighter1_489_518_Closed_Text.style.display='inline';" src="http://www.cppblog.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_489_518_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_489_518_Closed_Text.style.display='none'; Codehighlighter1_489_518_Open_Image.style.display='inline'; Codehighlighter1_489_518_Open_Text.style.display='inline';" src="http://www.cppblog.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_489_518_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.cppblog.com/Images/dot.gif"></span><span id=Codehighlighter1_489_518_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;(e</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">d)</span><span style="COLOR: #000000">%</span><span style="COLOR: #000000">m;<br><img src="http://www.cppblog.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;d&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;(d</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">d)</span><span style="COLOR: #000000">%</span><span style="COLOR: #000000">m;<br><img src="http://www.cppblog.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tmp</span><span style="COLOR: #000000">+=</span><span style="COLOR: #000000">e;<br><img src="http://www.cppblog.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cout</span><span style="COLOR: #000000">&lt;&lt;</span><span style="COLOR: #000000">(m</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">tmp</span><span style="COLOR: #000000">%</span><span style="COLOR: #000000">m)</span><span style="COLOR: #000000">%</span><span style="COLOR: #000000">m</span><span style="COLOR: #000000">&lt;&lt;</span><span style="COLOR: #000000">endl;<br><img src="http://www.cppblog.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&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 src="http://www.cppblog.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br><img src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" align=top></span></div>
<img src ="http://www.cppblog.com/xdu010/aggbug/58800.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/xdu010/" target="_blank">OIO</a> 2008-08-14 07:13 <a href="http://www.cppblog.com/xdu010/archive/2008/08/14/58800.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>pku2853</title><link>http://www.cppblog.com/xdu010/archive/2008/08/05/58097.html</link><dc:creator>OIO</dc:creator><author>OIO</author><pubDate>Tue, 05 Aug 2008 15:29:00 GMT</pubDate><guid>http://www.cppblog.com/xdu010/archive/2008/08/05/58097.html</guid><wfw:comment>http://www.cppblog.com/xdu010/comments/58097.html</wfw:comment><comments>http://www.cppblog.com/xdu010/archive/2008/08/05/58097.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/xdu010/comments/commentRss/58097.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/xdu010/services/trackbacks/58097.html</trackback:ping><description><![CDATA[<p>//题目的讨论中有另外一种的解法，不过下边这种方法也可以<br>&nbsp;//此题跟2140是有区别的<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"><span style="COLOR: #008080">&nbsp;1</span><img src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #000000">#include&nbsp;</span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">iostream</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">&nbsp;2</span><span style="COLOR: #000000"><img src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" align=top>#include</span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">cmath</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">&nbsp;3</span><span style="COLOR: #000000"><img src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" align=top></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></span><span style="COLOR: #008080">&nbsp;4</span><span style="COLOR: #000000"><img src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" align=top><br></span><span style="COLOR: #008080">&nbsp;5</span><span style="COLOR: #000000"><img src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&nbsp;main()<br></span><span style="COLOR: #008080">&nbsp;6</span><span style="COLOR: #000000"><img id=Codehighlighter1_69_478_Open_Image style="DISPLAY: inline" onclick="this.style.display='none'; Codehighlighter1_69_478_Open_Text.style.display='none'; Codehighlighter1_69_478_Closed_Image.style.display='inline'; Codehighlighter1_69_478_Closed_Text.style.display='inline';" src="http://www.cppblog.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_69_478_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_69_478_Closed_Text.style.display='none'; Codehighlighter1_69_478_Open_Image.style.display='inline'; Codehighlighter1_69_478_Open_Text.style.display='inline';" src="http://www.cppblog.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_69_478_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.cppblog.com/Images/dot.gif"></span><span id=Codehighlighter1_69_478_Open_Text style="DISPLAY: inline"><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">&nbsp;7</span><span style="COLOR: #000000"><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&nbsp;n;<br></span><span style="COLOR: #008080">&nbsp;8</span><span style="COLOR: #000000"><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;cin</span><span style="COLOR: #000000">&gt;&gt;</span><span style="COLOR: #000000">n;<br></span><span style="COLOR: #008080">&nbsp;9</span><span style="COLOR: #000000"><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&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">)<br></span><span style="COLOR: #008080">10</span><span style="COLOR: #000000"><img id=Codehighlighter1_114_452_Open_Image onclick="this.style.display='none'; Codehighlighter1_114_452_Open_Text.style.display='none'; Codehighlighter1_114_452_Closed_Image.style.display='inline'; Codehighlighter1_114_452_Closed_Text.style.display='inline';" src="http://www.cppblog.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_114_452_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_114_452_Closed_Text.style.display='none'; Codehighlighter1_114_452_Open_Image.style.display='inline'; Codehighlighter1_114_452_Open_Text.style.display='inline';" src="http://www.cppblog.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_114_452_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.cppblog.com/Images/dot.gif"></span><span id=Codehighlighter1_114_452_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">11</span><span style="COLOR: #000000"><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&nbsp;pronum;<br></span><span style="COLOR: #008080">12</span><span style="COLOR: #000000"><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000">&nbsp;x1,x2;&nbsp;<br></span><span style="COLOR: #008080">13</span><span style="COLOR: #000000"><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;</span><span style="COLOR: #0000ff">long</span><span style="COLOR: #000000">&nbsp;number,&nbsp;result</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">,j,x3;<br></span><span style="COLOR: #008080">14</span><span style="COLOR: #000000"><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cin</span><span style="COLOR: #000000">&gt;&gt;</span><span style="COLOR: #000000">pronum</span><span style="COLOR: #000000">&gt;&gt;</span><span style="COLOR: #000000">number;<br></span><span style="COLOR: #008080">15</span><span style="COLOR: #000000"><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x1</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">number;<br></span><span style="COLOR: #008080">16</span><span style="COLOR: #000000"><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;x2</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">sqrt(</span><span style="COLOR: #0000ff">float</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">&nbsp;number));<br></span><span style="COLOR: #008080">17</span><span style="COLOR: #000000"><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;x3</span><span style="COLOR: #000000">=</span><span style="COLOR: #0000ff">long</span><span style="COLOR: #000000">(x2);<br></span><span style="COLOR: #008080">18</span><span style="COLOR: #000000"><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(j</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">;j&nbsp;</span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">&nbsp;x3</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">)<br></span><span style="COLOR: #008080">19</span><span style="COLOR: #000000"><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">((</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">&nbsp;number&nbsp;</span><span style="COLOR: #000000">%</span><span style="COLOR: #000000">&nbsp;j&nbsp;</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">)&nbsp;</span><span style="COLOR: #000000">&amp;&amp;</span><span style="COLOR: #000000">&nbsp;(j&nbsp;</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">&nbsp;number&nbsp;</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">&nbsp;j)&nbsp;</span><span style="COLOR: #000000">%</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">)<br></span><span style="COLOR: #008080">20</span><span style="COLOR: #000000"><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">21</span><span style="COLOR: #000000"><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cout</span><span style="COLOR: #000000">&lt;&lt;</span><span style="COLOR: #000000">pronum</span><span style="COLOR: #000000">&lt;&lt;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&lt;&lt;</span><span style="COLOR: #000000">result</span><span style="COLOR: #000000">&lt;&lt;</span><span style="COLOR: #000000">endl;<br></span><span style="COLOR: #008080">22</span><span style="COLOR: #000000"><img src="http://www.cppblog.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br></span><span style="COLOR: #008080">23</span><span style="COLOR: #000000"><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;<br></span><span style="COLOR: #008080">24</span><span style="COLOR: #000000"><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&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></span><span style="COLOR: #008080">25</span><span style="COLOR: #000000"><img src="http://www.cppblog.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">26</span><span style="COLOR: #000000"><img src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" align=top><br></span><span style="COLOR: #008080">27</span><span style="COLOR: #000000"><img src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" align=top></span></div>
<img src ="http://www.cppblog.com/xdu010/aggbug/58097.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/xdu010/" target="_blank">OIO</a> 2008-08-05 23:29 <a href="http://www.cppblog.com/xdu010/archive/2008/08/05/58097.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>MFC程序 关闭程序窗口</title><link>http://www.cppblog.com/xdu010/archive/2008/05/20/50576.html</link><dc:creator>OIO</dc:creator><author>OIO</author><pubDate>Tue, 20 May 2008 13:44:00 GMT</pubDate><guid>http://www.cppblog.com/xdu010/archive/2008/05/20/50576.html</guid><wfw:comment>http://www.cppblog.com/xdu010/comments/50576.html</wfw:comment><comments>http://www.cppblog.com/xdu010/archive/2008/05/20/50576.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/xdu010/comments/commentRss/50576.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/xdu010/services/trackbacks/50576.html</trackback:ping><description><![CDATA[<p style="COLOR: #0000ff">建立一个对话框。<br><br>添加一个列表框，改变按钮 OK 的标题为 Close，删除 Cancel 按钮。将对话框的标题改为 TerminateTask。<br><br>在对话框中添两个按钮，标题分别为 Close App 和 Quit App。<br><br>CTerminateTaskDlg的OnInitDialog 方法中添加如下代码<br><br>BOOL CTerminateTaskDlg::OnInitDialog() <br>　　{ <br>　　&nbsp;&nbsp;&nbsp;&nbsp;CDialog::OnInitDialog(); <br>　　&nbsp;&nbsp;&nbsp;&nbsp;CListBox * list=(CListBox *)GetDlgItem(IDC_LIST1); <br>　　&nbsp;&nbsp;&nbsp;&nbsp;list-&gt;ResetContent(); <br>　　&nbsp;&nbsp;&nbsp;&nbsp;EnumWindows(EnumWindowsProc,(LPARAM)list);<br>　　&nbsp;&nbsp;&nbsp;&nbsp;CenterWindow(); <br>　　&nbsp;&nbsp;&nbsp;&nbsp;return TRUE;&nbsp;&nbsp;// return TRUE unless you set the focus to a control <br>　　} <br><br>在上边添加函数<br><br>static BOOL CALLBACK EnumWindowsProc(HWND hwnd,LPARAM lParam)<br>{<br>&nbsp;&nbsp;&nbsp; CListBox * list=(CListBox *)lParam;</p>
<p style="COLOR: #0000ff">&nbsp;&nbsp;&nbsp; char&nbsp; buf[256];<br>&nbsp;&nbsp;&nbsp; GetWindowText(hwnd,buf,256);</p>
<p style="COLOR: #0000ff">&nbsp;&nbsp;&nbsp; if(strlen(buf))<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;int idx=list-&gt;AddString(buf);<br>&nbsp;&nbsp;list-&gt;SetItemData(idx,(DWORD)hwnd);<br>&nbsp;&nbsp;&nbsp; }</p>
<p style="COLOR: #0000ff">&nbsp;&nbsp;&nbsp; return TRUE;<br>}<br><br>建立&nbsp;ID_BUTTON1，命名方法为 OnCloseApp，并在此方法中添加下列代码： <br>　　void CTerminateTaskDlg::OnCloseApp() <br>　　{ <br>　　&nbsp;&nbsp;&nbsp;&nbsp;CListBox * list=(CListBox *)GetDlgItem(IDC_LIST1); <br>　　&nbsp;&nbsp;&nbsp;&nbsp;int idx=list-&gt;GetCurSel(); <br>　　&nbsp;&nbsp;&nbsp;&nbsp;if(idx==LB_ERR) <br>　　&nbsp;&nbsp;&nbsp;&nbsp;{ <br>　　MessageBox("You must select a window to active!", <br>　　&nbsp;&nbsp;&nbsp;&nbsp;"Error",MB_OK|MB_APPLMODAL); <br>　　return; <br>　　&nbsp;&nbsp;&nbsp;&nbsp;} <br>　　&nbsp;&nbsp;&nbsp;&nbsp;HWND hWnd=(HWND)list-&gt;GetItemData(idx); <br>　　&nbsp;&nbsp;&nbsp;&nbsp;::PostMessage(hWnd,WM_CLOSE,0,0L); <br>　　&nbsp;&nbsp;&nbsp;&nbsp;EndDialog(IDOK); <br>　　} <br><br>编译并运行此例子程序。<br></p>
可以用HWND&nbsp;&nbsp; hWnd&nbsp;&nbsp; =&nbsp;&nbsp; ::FindWindow(NULL,"windows name") ;<br><br>关闭一个制定的程序，还可以用上边的程序查看具体的windows name，注意windows name为窗口的caption。
<img src ="http://www.cppblog.com/xdu010/aggbug/50576.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/xdu010/" target="_blank">OIO</a> 2008-05-20 21:44 <a href="http://www.cppblog.com/xdu010/archive/2008/05/20/50576.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>windows编程</title><link>http://www.cppblog.com/xdu010/archive/2008/05/14/49873.html</link><dc:creator>OIO</dc:creator><author>OIO</author><pubDate>Wed, 14 May 2008 13:56:00 GMT</pubDate><guid>http://www.cppblog.com/xdu010/archive/2008/05/14/49873.html</guid><wfw:comment>http://www.cppblog.com/xdu010/comments/49873.html</wfw:comment><comments>http://www.cppblog.com/xdu010/archive/2008/05/14/49873.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/xdu010/comments/commentRss/49873.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/xdu010/services/trackbacks/49873.html</trackback:ping><description><![CDATA[&nbsp;<span style="COLOR: #0000ff">case WM_CLOSE:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 0;</span><br><br>在窗口消息处理时加上上边两句，程序就只能用资源管理器关闭了<br><br>----封装的越多，越方便，越臃肿，越让人不自在，我们只是要找到平衡点<br>
<img src ="http://www.cppblog.com/xdu010/aggbug/49873.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/xdu010/" target="_blank">OIO</a> 2008-05-14 21:56 <a href="http://www.cppblog.com/xdu010/archive/2008/05/14/49873.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>L宏 </title><link>http://www.cppblog.com/xdu010/archive/2008/05/09/49286.html</link><dc:creator>OIO</dc:creator><author>OIO</author><pubDate>Fri, 09 May 2008 02:57:00 GMT</pubDate><guid>http://www.cppblog.com/xdu010/archive/2008/05/09/49286.html</guid><wfw:comment>http://www.cppblog.com/xdu010/comments/49286.html</wfw:comment><comments>http://www.cppblog.com/xdu010/archive/2008/05/09/49286.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cppblog.com/xdu010/comments/commentRss/49286.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/xdu010/services/trackbacks/49286.html</trackback:ping><description><![CDATA[<span style="COLOR: #3366ff">l"string"表示unicode字符串，是const &nbsp; wchar &nbsp; *类型，一个字符有16位。而_t("string")的含义和_unicode宏定义有关，如果_unicode定义，则_t("string")和l"string"一样，否则_t("string")是普通字符串。 &nbsp; <br>&nbsp; &nbsp; <br>&nbsp; char &nbsp; buff[] &nbsp; = &nbsp; "string"; &nbsp; <br>&nbsp; wchar &nbsp; buff[]=l"string"</span> <br><br>--谢谢两位的回复，这个是编译器相关，我改正了
<img src ="http://www.cppblog.com/xdu010/aggbug/49286.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/xdu010/" target="_blank">OIO</a> 2008-05-09 10:57 <a href="http://www.cppblog.com/xdu010/archive/2008/05/09/49286.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>bmp图片格式学习（c++代码）</title><link>http://www.cppblog.com/xdu010/archive/2008/05/08/49181.html</link><dc:creator>OIO</dc:creator><author>OIO</author><pubDate>Thu, 08 May 2008 02:00:00 GMT</pubDate><guid>http://www.cppblog.com/xdu010/archive/2008/05/08/49181.html</guid><wfw:comment>http://www.cppblog.com/xdu010/comments/49181.html</wfw:comment><comments>http://www.cppblog.com/xdu010/archive/2008/05/08/49181.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.cppblog.com/xdu010/comments/commentRss/49181.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/xdu010/services/trackbacks/49181.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: &nbsp;//这个程序用来读取256*256大小的单色bmp黑白图片，适当修改就可读取任意大小任意//颜色的bmp图片，在生成文件里，0和1表示黑白，不过用记事本查看会有乱码//可以用UE查看16进制形式，没有问题的#include&nbsp;&lt;fstream&gt;#include&nbsp;&lt;iostream&gt;using&nbsp;namespace&nbsp;std;...&nbsp;&nbsp;<a href='http://www.cppblog.com/xdu010/archive/2008/05/08/49181.html'>阅读全文</a><img src ="http://www.cppblog.com/xdu010/aggbug/49181.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/xdu010/" target="_blank">OIO</a> 2008-05-08 10:00 <a href="http://www.cppblog.com/xdu010/archive/2008/05/08/49181.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>构建ubuntu上的java开发环境</title><link>http://www.cppblog.com/xdu010/archive/2008/03/12/44274.html</link><dc:creator>OIO</dc:creator><author>OIO</author><pubDate>Wed, 12 Mar 2008 06:46:00 GMT</pubDate><guid>http://www.cppblog.com/xdu010/archive/2008/03/12/44274.html</guid><wfw:comment>http://www.cppblog.com/xdu010/comments/44274.html</wfw:comment><comments>http://www.cppblog.com/xdu010/archive/2008/03/12/44274.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/xdu010/comments/commentRss/44274.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/xdu010/services/trackbacks/44274.html</trackback:ping><description><![CDATA[<span style="color: #1826ff;">1，安装sun-java5-*
，用新立得在安装过程中会有个提示</span><br style="color: #1826ff;"><span style="color: #1826ff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 就是按照要求在sun的网站
上下载相应的文档sun-java5-doc
，放到/tmp文件夹下，</span><br style="color: #1826ff;"><span style="color: #1826ff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 然后输入RETURN回车就可以安装好JDK了，当然JRE也安装好了</span><br style="color: #1826ff;"><span style="color: #1826ff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 估计java6的包也一样安装</span><br style="color: #1826ff;"><span style="color: #1826ff;">2，下载Eclipse IDE
，去官方网站下吧，速度很快</span><br style="color: #1826ff;"><span style="color: #1826ff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 下载了tar.gz文件直接解压就可以用了，什么也不需要设置</span><br style="color: #1826ff;"><br style="color: #1826ff;"><span style="color: #1826ff;">就是这么简单，呵呵，现在我可以在ubuntu上查看和编辑java项目了。</span><br><br><img src ="http://www.cppblog.com/xdu010/aggbug/44274.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/xdu010/" target="_blank">OIO</a> 2008-03-12 14:46 <a href="http://www.cppblog.com/xdu010/archive/2008/03/12/44274.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Hibernate学习笔记一－－－－印象</title><link>http://www.cppblog.com/xdu010/archive/2008/03/12/44272.html</link><dc:creator>OIO</dc:creator><author>OIO</author><pubDate>Wed, 12 Mar 2008 06:32:00 GMT</pubDate><guid>http://www.cppblog.com/xdu010/archive/2008/03/12/44272.html</guid><wfw:comment>http://www.cppblog.com/xdu010/comments/44272.html</wfw:comment><comments>http://www.cppblog.com/xdu010/archive/2008/03/12/44272.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/xdu010/comments/commentRss/44272.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/xdu010/services/trackbacks/44272.html</trackback:ping><description><![CDATA[Hibernate是替JAVA设计的轻量级O／R映射服务，即对象／关系型数据库映射（Object/Relational Mapping）
<br><br>JDBC+DAO存在很多困难，很难做到把关系表记录完整的映射到持久对象的关系上来，这主要体现在多表的关系无法直接映射到对持久对象的映射上
来，可能是一个表映射多个持久对象，有可能是多个表映射一个持久对象，更有可能的是表的某些字段映射到一个持久对象，但是另外一些字段映射到别的持久对象
上。<br><br>Hibernate试图弥补这些缺陷<br><br>我的感觉是应用hibernate简化数据库操作，确实有着很大的优势和前景 <br><br><img src ="http://www.cppblog.com/xdu010/aggbug/44272.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/xdu010/" target="_blank">OIO</a> 2008-03-12 14:32 <a href="http://www.cppblog.com/xdu010/archive/2008/03/12/44272.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ubuntu7.10边配置边学习</title><link>http://www.cppblog.com/xdu010/archive/2008/02/27/43346.html</link><dc:creator>OIO</dc:creator><author>OIO</author><pubDate>Wed, 27 Feb 2008 09:12:00 GMT</pubDate><guid>http://www.cppblog.com/xdu010/archive/2008/02/27/43346.html</guid><wfw:comment>http://www.cppblog.com/xdu010/comments/43346.html</wfw:comment><comments>http://www.cppblog.com/xdu010/archive/2008/02/27/43346.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cppblog.com/xdu010/comments/commentRss/43346.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/xdu010/services/trackbacks/43346.html</trackback:ping><description><![CDATA[<span style="font-family: 微软雅黑; font-size: 10pt;">前言：</span><br style="font-family: 微软雅黑;"><span style="font-family: 微软雅黑;">安装ubuntu7.10以后就不再用suse了，虽然感觉开始时suse更华丽，可是对于新手，ubuntu基于debian的apt-get还是让我感觉更容易接受。利用</span><br style="font-family: 微软雅黑;"><code style="color: #3844ff; font-family: 微软雅黑;">sudo apt-get install compiz compiz-gnome compiz-fusion-* <br>compizconfig-settings-manager libcompizconfig-backend-gconf<br><span style="color: #020000;">可以方便的开启3D效果，于vsita有过之而无不及，这也是我选择ubuntu而不是arch等其他出色linux版本的原因。当然安装3D效果有一定危险，还是慎用。<br>开始：<br></span></code><span style="font-family: 微软雅黑;">下边是我配置ubuntu的一些心得体会：</span><br style="font-family: 微软雅黑;"><span style="font-family: 微软雅黑;">一，安装&nbsp; 这个过程很简单，ubuntu的安装和XP一样简单，相关内容可以google得到（一定要善于google），我的ubuntu在自己的本本上安装的很顺利，连nvidia的显卡驱动也可以用，所以这一步并不麻烦，这里不细说了。</span><br style="font-family: 微软雅黑;"><span style="font-family: 微软雅黑;">二，安装好了以后先要更新系统。</span><br style="font-family: 微软雅黑;"><code style="font-family: 微软雅黑;"><span style="color: #1826ff;">sudo gedit /etc/apt/sources.list</span><br>在里边添加源</code><code style="font-family: 微软雅黑;">deb http://＊＊＊＊＊＊或ftp的</code><code style="font-family: 微软雅黑;">，最好是官方的，一定要是7。10版本的源，cn99速度很快，我的源经常会换，这个可以自己设定。<br>然后更新<br></code><code style="font-family: 微软雅黑;"><span style="color: #1826ff;">sudo apt-get update</span><br style="color: #1826ff;"><span style="color: #1826ff;">
sudo apt-get upgrade</span><br>就可以了<br>三，谈谈一些软件的安装，没有先后顺序，大家根据需要选用<br>1，compiz<br></code><code style="font-family: 微软雅黑;"><span style="color: #1826ff;">sudo apt-get install compiz compiz-gnome compiz-fusion-*</span><br>我玩了一阵之后就有点腻了，具体的设置可以看这篇文章<br><span style="color: #1826ff;">http://www.osxcn.com/ubuntu/howto-install-compiz-fusion-on-ubuntu.html</span><br>我会在这篇文章里多多引用</code><small style="font-family: 微软雅黑;">Nicky's blog，<span style="font-size: 18pt;"><span style="font-size: 24pt;"><span style="font-size: 36pt;"><span style="font-size: 14pt;"><span style="font-size: 10pt;">我从他的文章里学到很多，我只是汇总自己的心得。<br>2，QQ<br>可以用pidgin登入，这个ubuntu自带，还可以用EVA，这个需要安装java环境，但是因为腾讯（不知是爱还是该恨）经常更换协议，所以更多的时候建议用<br>wine，wine的安装在下边提到，然后用wine模拟登入，wine和scim输入法会有些冲突，google的话会很快解决，就是更改下scim的设置。<br>3，wine<br>这真是个天才的软件，很大程度上解决了ubuntu软件支持的问题，还可以用来&#8220;魔兽&#8221;，我还没试过，先说下下载和使用<br>用新立得下载，对于ubuntu的软件，自己下载源码编译当然最好，但是对于新手，并不能忽略源码编译错误所造成的困难，所以建议如果不是十分必要，就用新立得，虽然它的缺点也很明显，就是太透明，有时候不小心你甚至找不到安装的目录。<br>对于wine下运行qq，建议用wine运行qq的安装程序安装一次，而不是直接运行qq.exe</span></span></span></span></span><br></small><code style="font-family: 微软雅黑;">删除</code><span style="font-family: 微软雅黑;">Tencent/QQ／TIMPlatform.exe这个文件，以免运行后崩溃。</span><br style="font-family: 微软雅黑;"><span style="font-family: 微软雅黑;">很好的文章在这里<span style="color: #1826ff;">http://dangaoz.jsp-tech.cn/2007/10/ubuntuwineqq.html</span></span><br style="font-family: 微软雅黑;"><span style="font-family: 微软雅黑;">4，mplayer</span><br style="font-family: 微软雅黑;"><span style="font-family: 微软雅黑;">我自己这个软件安装的不好，给个链接，大家自己去试试吧<span style="color: #1826ff;">http://tiyileo.blogbus.com/logs/8092937.html</span>。我自己的mplayer性能并不让我满意</span><br style="font-family: 微软雅黑;"><span style="font-family: 微软雅黑;">5，设置VIM</span><br style="font-family: 微软雅黑;"><span style="font-family: 微软雅黑;">你可以通过设置自带的GVIM编写c或c＋＋程序，我一般用这两种语言，编译器用gdb，gcc,g++。我认为编辑文本用gedit对于XP转来的用户更亲切，同样它具有语法高亮功能，关于配置VIM文件vimrc，实现个性话，具体的看个人喜欢，方法就google吧。通过首选项设置字体和背景，我很喜欢这个设置功能，使VIM看起来更个性。</span><br style="font-family: 微软雅黑;"><span style="font-family: 微软雅黑;">6，安装主题</span><br style="font-family: 微软雅黑;"><span style="font-family: 微软雅黑;">grub背景可以改，不过我觉得没有背景也很好看</span><br style="font-family: 微软雅黑;"><span style="font-family: 微软雅黑;">然后是usplash主题，我的做法是下载so后改名替换原来</span><code style="font-family: 微软雅黑;">/usr/lib/usplash/下的默认so文件，然后更新系统<br></code><code style="font-family: 微软雅黑;"><span style="color: #1826ff;">sudo dpkg-reconfigure linux-image-$(uname -r)</span>千万不要忘记这一步<br>为什么不用启动管理器</code><span style="font-family: 微软雅黑;"> startupmanager？</span><code><span style="font-family: 微软雅黑;">因为网上的一些相关做法我用不成功</span><br style="font-family: 微软雅黑;"><span style="font-family: 微软雅黑;">然后是登入画面，这个比较容易，系统－》管理－》登入窗口－》本地 就可以更改</span><br style="font-family: 微软雅黑;"><span style="font-family: 微软雅黑;">然后是一片土黄色，这个可以这样改 ：把/etc/gdm/PreSession/Default中的default颜色改了就可以了 ，颜色值可以从桌面改变背景颜色那查出来</span><br style="font-family: 微软雅黑;"><span style="font-family: 微软雅黑;">然后是splash screen图片，我觉得可有可无，启动软件更改图片就可以，很容易</span><br style="font-family: 微软雅黑;"><span style="font-family: 微软雅黑;">最后安装桌面主题，在桌面右键就可以设置，很简单吧？还可以个性化边框等信息</span><br style="font-family: 微软雅黑;"><span style="font-family: 微软雅黑;">7，还有字体和输入法的问题，其实应该在开始解决，这也是个相对麻烦的问题，网上有很多资料，雅黑字体在很多网站已经不提供下载了，大家根据需要安装吧</span><br style="font-family: 微软雅黑;"><br style="font-family: 微软雅黑;"><span style="font-family: 微软雅黑;">还有很多软件，以后再补充介绍吧，介绍个linux软件的网站</span><br style="font-family: 微软雅黑;"><span style="font-family: 微软雅黑; color: #1826ff;">http://linuxtoy.org/</span><br style="font-family: 微软雅黑;"><span style="font-family: 微软雅黑;">里边可以找到很多很有意思的软件，小便簽。<br><br>当然你可以到ubuntu中文论坛去寻找帮助，里边有很多相当好的文章，尤其是新手区，我在这里只是总结自己的经验，希望对大家也能有所帮助，希望用ubuntu的人越来越多。大家自己有什么配置方面独特的方法，请多在评论里与我交流吧。<br></span></code><br><img src ="http://www.cppblog.com/xdu010/aggbug/43346.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/xdu010/" target="_blank">OIO</a> 2008-02-27 17:12 <a href="http://www.cppblog.com/xdu010/archive/2008/02/27/43346.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>我所做的DP题目-pku版</title><link>http://www.cppblog.com/xdu010/archive/2008/01/17/41317.html</link><dc:creator>OIO</dc:creator><author>OIO</author><pubDate>Thu, 17 Jan 2008 02:14:00 GMT</pubDate><guid>http://www.cppblog.com/xdu010/archive/2008/01/17/41317.html</guid><wfw:comment>http://www.cppblog.com/xdu010/comments/41317.html</wfw:comment><comments>http://www.cppblog.com/xdu010/archive/2008/01/17/41317.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/xdu010/comments/commentRss/41317.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/xdu010/services/trackbacks/41317.html</trackback:ping><description><![CDATA[<span style="COLOR: #0000ff">pku1080<br>pku1088<br>pku1160<br>pku1191<br>pku1163<br>pku1179<br>pku1189<br>pku1338<br>pku1458<br></span><span style="COLOR: #0000ff">pku1038<br></span><span style="COLOR: #0000ff">pku1170</span><br>
<img src ="http://www.cppblog.com/xdu010/aggbug/41317.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/xdu010/" target="_blank">OIO</a> 2008-01-17 10:14 <a href="http://www.cppblog.com/xdu010/archive/2008/01/17/41317.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>