﻿<?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++博客-The Humble Programmer-随笔分类-程序设计</title><link>http://www.cppblog.com/stan/category/2981.html</link><description>Simple is better than complex.</description><language>zh-cn</language><lastBuildDate>Sun, 25 May 2008 08:16:43 GMT</lastBuildDate><pubDate>Sun, 25 May 2008 08:16:43 GMT</pubDate><ttl>60</ttl><item><title>读书狂想：《计算机程序的构造和解释》</title><link>http://www.cppblog.com/stan/archive/2006/11/19/15430.html</link><dc:creator>The Humble Programmer</dc:creator><author>The Humble Programmer</author><pubDate>Sun, 19 Nov 2006 11:45:00 GMT</pubDate><guid>http://www.cppblog.com/stan/archive/2006/11/19/15430.html</guid><wfw:comment>http://www.cppblog.com/stan/comments/15430.html</wfw:comment><comments>http://www.cppblog.com/stan/archive/2006/11/19/15430.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.cppblog.com/stan/comments/commentRss/15430.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/stan/services/trackbacks/15430.html</trackback:ping><description><![CDATA[
		<font size="2">《计算机程序的构造和解释》（原书第二版）<br /><br />         今天读了前几节，突然有点小感触。前几天还在想去大觉寺喝茶，而今天在这本书上就找到了一种“禅”的味道。<br />         很久没见过这样的书了，这本书更像一本数学书、一本哲学著作。让人不得不佩服麻省理工的治学水平了。市面上充斥了无数的先进技术的书籍，从C到C#，从Java到Ajax，新技术名词满天飞。每本书都有大量的拥护者、卫道士，经典书籍也充满了浮躁的气息。<br /><br />         我不否认，我也或多或少带上了一些浮躁之气。心里有一个纯净的小花园，独独喜欢理论的研究。但业界的“八风”吹来又吹去，难免让人“吹动”一下。在网上，一面是某些关心学生的专家说，不要去学.NET，不要去学新的业界技术，另一面又是找人的企业打出的要求是“十项全能”，他们心中理想的人才啊，一个人绝对顶一个开发组。<br /><br />         这段时间也被藐视了好多，徒有一身的本领，却处处被那些“计算机系”的人压着。实验室招实习生、招毕设实习等等，一听说俺是学航空了，都恨不得绕着走，能不理就不理。是不是所谓的“计算机系的”，不管学好学坏，都比我牛呢？牛在哪里？牛在C语言程序都不会写？牛在一个简单的词法分析作业都要拷贝？牛在学数据结构不上机？牛在不会最简单的排序算法和Dijkstra算法？<br /><br />         呵呵我其实很佩服一些学计算机的高手的，比如交大的狗狗，很执着地钻研，很执着地CODING；华工的李浩，好久没联系了，但是能感觉他的热情；北邮的大吊妖（！），不爱写代码，但是对前沿的东西都很了解……我只是很不爽某些人某些事啊。<br /><br />         当然一切，我都要继续争取。屡战屡败屡败屡战。<br /><br />         似乎说远了，要说说这本书了。摘录原书上的一句话，每个严肃的计算机科学家都应该读一读这本书。这书不是用流行的Java语言写成，不是C++，甚至都不是C不是PASCAL，而是Lisp/Scheme。语言在这本书里面只是个表示的方法，Lisp/Scheme本来就是让你用最多的时间去思考而用最少的时间去关注语言特性。我才看了第一章的前几节，Lisp/Scheme确实很有趣，把一切都看作了函数。比如(+ 2 3)可以看做add(2,3)之类的，刨掉了花哨的语言特性，连for/while都没有，只全心全意的讨论了递归和迭代。递归和迭代！简单的过程蕴含和多深的道理啊，有太极的意味，有禅的内敛。当把一个Ackermann函数和一个Fibbonacci数列解剖来看的时候，你才会发现你了解的还是很少了。<br /><br />         我说得有点过了，但是我真的很推荐想了解计算机科学的人看看这本书，当你还在为学什么语言而苦恼的时候，要知道语言只是思想的表示方法。只有语言背后的东西，才是你该了解的。<br /><br />         我还在继续看，以后会有继续的感想～</font>
<img src ="http://www.cppblog.com/stan/aggbug/15430.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/stan/" target="_blank">The Humble Programmer</a> 2006-11-19 19:45 <a href="http://www.cppblog.com/stan/archive/2006/11/19/15430.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>一个无聊的小程序</title><link>http://www.cppblog.com/stan/archive/2006/11/16/15268.html</link><dc:creator>The Humble Programmer</dc:creator><author>The Humble Programmer</author><pubDate>Thu, 16 Nov 2006 15:22:00 GMT</pubDate><guid>http://www.cppblog.com/stan/archive/2006/11/16/15268.html</guid><wfw:comment>http://www.cppblog.com/stan/comments/15268.html</wfw:comment><comments>http://www.cppblog.com/stan/archive/2006/11/16/15268.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/stan/comments/commentRss/15268.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/stan/services/trackbacks/15268.html</trackback:ping><description><![CDATA[
		<font size="2">今天在CSDN上看见别人的一个作业题求助，下午给写了下来。<br />以前写JAVA里面的数据类型转换很方便，今天看了看C++的REFERENCE发现C++的实现更灵活。呵呵越来越迷上C++了。详见toInt()和toStr()函数<br />慢慢学，加油。<br /><br />现在很困惑的一点就是原文的算法书看得不很懂，中文的图书馆难借到，不看又不敢。唉。有没有人能推荐一本英语写得比较容易懂的算法和数据结构的书啊……</font>
		<br />
		<br />
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<img id="Codehighlighter1_0_212_Open_Image" onclick="this.style.display='none'; Codehighlighter1_0_212_Open_Text.style.display='none'; Codehighlighter1_0_212_Closed_Image.style.display='inline'; Codehighlighter1_0_212_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" />
				<img id="Codehighlighter1_0_212_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_0_212_Closed_Text.style.display='none'; Codehighlighter1_0_212_Open_Image.style.display='inline'; Codehighlighter1_0_212_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedBlock.gif" align="top" />
				<span id="Codehighlighter1_0_212_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</span>
				<span id="Codehighlighter1_0_212_Open_Text">
						<span style="COLOR: #008000">/*</span>
						<span style="COLOR: #008000">输入产品编号<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />如:A1-5,B2-10<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />为了方便用户输入,程序可采用简写输入<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />   输入              输出<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />   A1-10              A1-10<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />   A1-7,8             A1-7 A1-8<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />   B1-2'4             B1-2 B1-3 B1-4<br /><img src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />   C2-2'4,6'8         C2-2 C2-3 C2-4 C2-6 C2-7 C2-8</span>
						<span style="COLOR: #008000">*/</span>
				</span>
				<span style="COLOR: #000000">
						<br />
						<img src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align="top" />
						<br />
						<img src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align="top" />#include </span>
				<span style="COLOR: #000000">&lt;</span>
				<span style="COLOR: #000000">vector</span>
				<span style="COLOR: #000000">&gt;</span>
				<span style="COLOR: #000000">
						<br />
						<img src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align="top" />#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 src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align="top" />#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 src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align="top" />#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 src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align="top" />
						<br />
						<img src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align="top" />
				</span>
				<span style="COLOR: #0000ff">using</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #0000ff">namespace</span>
				<span style="COLOR: #000000"> std;<br /><img src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align="top" /></span>
				<span style="COLOR: #0000ff">string</span>
				<span style="COLOR: #000000"> expandStr(</span>
				<span style="COLOR: #0000ff">string</span>
				<span style="COLOR: #000000">&amp;</span>
				<span style="COLOR: #000000">);<br /><img src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align="top" /></span>
				<span style="COLOR: #0000ff">int</span>
				<span style="COLOR: #000000"> toInt(</span>
				<span style="COLOR: #0000ff">const</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #0000ff">string</span>
				<span style="COLOR: #000000">&amp;</span>
				<span style="COLOR: #000000">);<br /><img src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align="top" /></span>
				<span style="COLOR: #0000ff">string</span>
				<span style="COLOR: #000000"> toStr(</span>
				<span style="COLOR: #0000ff">const</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #0000ff">int</span>
				<span style="COLOR: #000000">);<br /><img src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align="top" /></span>
				<span style="COLOR: #0000ff">int</span>
				<span style="COLOR: #000000"> main()<br /><img id="Codehighlighter1_403_710_Open_Image" onclick="this.style.display='none'; Codehighlighter1_403_710_Open_Text.style.display='none'; Codehighlighter1_403_710_Closed_Image.style.display='inline'; Codehighlighter1_403_710_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_403_710_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_403_710_Closed_Text.style.display='none'; Codehighlighter1_403_710_Open_Image.style.display='inline'; Codehighlighter1_403_710_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span>
				<span id="Codehighlighter1_403_710_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_403_710_Open_Text">
						<span style="COLOR: #000000">{<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span>
						<span style="COLOR: #0000ff">string</span>
						<span style="COLOR: #000000"> str;<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span>
						<span style="COLOR: #0000ff">string</span>
						<span style="COLOR: #000000"> afterStr;<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />    cout</span>
						<span style="COLOR: #000000">&lt;&lt;</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">Insert[q to quit]: </span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">;<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />    cin</span>
						<span style="COLOR: #000000">&gt;&gt;</span>
						<span style="COLOR: #000000">str;<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />    </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">q</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">)<br /><img id="Codehighlighter1_513_694_Open_Image" onclick="this.style.display='none'; Codehighlighter1_513_694_Open_Text.style.display='none'; Codehighlighter1_513_694_Closed_Image.style.display='inline'; Codehighlighter1_513_694_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_513_694_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_513_694_Closed_Text.style.display='none'; Codehighlighter1_513_694_Open_Image.style.display='inline'; Codehighlighter1_513_694_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span>
						<span id="Codehighlighter1_513_694_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_513_694_Open_Text">
								<span style="COLOR: #000000">{<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />        afterStr </span>
								<span style="COLOR: #000000">=</span>
								<span style="COLOR: #000000"> expandStr(str);<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />        cout</span>
								<span style="COLOR: #000000">&lt;&lt;</span>
								<span style="COLOR: #000000">"</span>
								<span style="COLOR: #000000">\n&gt;&gt; Output:</span>
								<span style="COLOR: #000000">"</span>
								<span style="COLOR: #000000">&lt;&lt;</span>
								<span style="COLOR: #000000">endl;<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />        cout</span>
								<span style="COLOR: #000000">&lt;&lt;</span>
								<span style="COLOR: #000000">"</span>
								<span style="COLOR: #000000">&gt;&gt; </span>
								<span style="COLOR: #000000">"</span>
								<span style="COLOR: #000000">&lt;&lt;</span>
								<span style="COLOR: #000000">afterStr</span>
								<span style="COLOR: #000000">&lt;&lt;</span>
								<span style="COLOR: #000000">endl;<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />        cout</span>
								<span style="COLOR: #000000">&lt;&lt;</span>
								<span style="COLOR: #000000">"</span>
								<span style="COLOR: #000000">Insert[q to quit]: </span>
								<span style="COLOR: #000000">"</span>
								<span style="COLOR: #000000">;<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />        cin</span>
								<span style="COLOR: #000000">&gt;&gt;</span>
								<span style="COLOR: #000000">str;           <br /><img src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span>
						</span>
						<span style="COLOR: #000000">
								<br />
								<img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span>
						<span style="COLOR: #0000ff">return</span>
						<span style="COLOR: #000000"> </span>
						<span style="COLOR: #000000">0</span>
						<span style="COLOR: #000000">;<br /><img src="http://www.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" />
						<br />
						<img src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align="top" />
				</span>
				<span style="COLOR: #0000ff">string</span>
				<span style="COLOR: #000000"> expandStr(</span>
				<span style="COLOR: #0000ff">string</span>
				<span style="COLOR: #000000">&amp;</span>
				<span style="COLOR: #000000"> origStr)<br /><img id="Codehighlighter1_747_2323_Open_Image" onclick="this.style.display='none'; Codehighlighter1_747_2323_Open_Text.style.display='none'; Codehighlighter1_747_2323_Closed_Image.style.display='inline'; Codehighlighter1_747_2323_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_747_2323_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_747_2323_Closed_Text.style.display='none'; Codehighlighter1_747_2323_Open_Image.style.display='inline'; Codehighlighter1_747_2323_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span>
				<span id="Codehighlighter1_747_2323_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_747_2323_Open_Text">
						<span style="COLOR: #000000">{<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span>
						<span style="COLOR: #0000ff">string</span>
						<span style="COLOR: #000000"> afterStr </span>
						<span style="COLOR: #000000">=</span>
						<span style="COLOR: #000000"> </span>
						<span style="COLOR: #000000">""</span>
						<span style="COLOR: #000000">;<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span>
						<span style="COLOR: #0000ff">string</span>
						<span style="COLOR: #000000"> head </span>
						<span style="COLOR: #000000">=</span>
						<span style="COLOR: #000000"> </span>
						<span style="COLOR: #000000">""</span>
						<span style="COLOR: #000000">;  </span>
						<span style="COLOR: #008000">//</span>
						<span style="COLOR: #008000">型号的头部 </span>
						<span style="COLOR: #008000">
								<br />
								<img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />
						</span>
						<span style="COLOR: #000000">    </span>
						<span style="COLOR: #0000ff">string</span>
						<span style="COLOR: #000000"> tmpStr </span>
						<span style="COLOR: #000000">=</span>
						<span style="COLOR: #000000"> </span>
						<span style="COLOR: #000000">""</span>
						<span style="COLOR: #000000">;<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />    vector</span>
						<span style="COLOR: #000000">&lt;</span>
						<span style="COLOR: #0000ff">string</span>
						<span style="COLOR: #000000">&gt;</span>
						<span style="COLOR: #000000"> container;   </span>
						<span style="COLOR: #008000">//</span>
						<span style="COLOR: #008000">装载每个型号的数字部分 </span>
						<span style="COLOR: #008000">
								<br />
								<img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />
						</span>
						<span style="COLOR: #000000">    <br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span>
						<span style="COLOR: #0000ff">string</span>
						<span style="COLOR: #000000">::iterator beg </span>
						<span style="COLOR: #000000">=</span>
						<span style="COLOR: #000000"> origStr.begin();<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span>
						<span style="COLOR: #0000ff">string</span>
						<span style="COLOR: #000000">::iterator end </span>
						<span style="COLOR: #000000">=</span>
						<span style="COLOR: #000000"> origStr.end();<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />    <br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span>
						<span style="COLOR: #0000ff">while</span>
						<span style="COLOR: #000000">(</span>
						<span style="COLOR: #000000">'</span>
						<span style="COLOR: #000000">-</span>
						<span style="COLOR: #000000">'</span>
						<span style="COLOR: #000000"> </span>
						<span style="COLOR: #000000">!=</span>
						<span style="COLOR: #000000"> </span>
						<span style="COLOR: #000000">*</span>
						<span style="COLOR: #000000">beg)<br /><img id="Codehighlighter1_1001_1052_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1001_1052_Open_Text.style.display='none'; Codehighlighter1_1001_1052_Closed_Image.style.display='inline'; Codehighlighter1_1001_1052_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1001_1052_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1001_1052_Closed_Text.style.display='none'; Codehighlighter1_1001_1052_Open_Image.style.display='inline'; Codehighlighter1_1001_1052_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span>
						<span id="Codehighlighter1_1001_1052_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_1001_1052_Open_Text">
								<span style="COLOR: #000000">{<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />        head.push_back(</span>
								<span style="COLOR: #000000">*</span>
								<span style="COLOR: #000000">beg);<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span>
								<span style="COLOR: #000000">++</span>
								<span style="COLOR: #000000">beg;<br /><img src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span>
						</span>
						<span style="COLOR: #000000">
								<br />
								<img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />    head </span>
						<span style="COLOR: #000000">+=</span>
						<span style="COLOR: #000000"> </span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">-</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">;<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span>
						<span style="COLOR: #000000">++</span>
						<span style="COLOR: #000000">beg;<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />    <br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span>
						<span style="COLOR: #0000ff">for</span>
						<span style="COLOR: #000000">( ; beg </span>
						<span style="COLOR: #000000">&lt;</span>
						<span style="COLOR: #000000"> end; </span>
						<span style="COLOR: #000000">++</span>
						<span style="COLOR: #000000">beg)<br /><img id="Codehighlighter1_1120_2039_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1120_2039_Open_Text.style.display='none'; Codehighlighter1_1120_2039_Closed_Image.style.display='inline'; Codehighlighter1_1120_2039_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1120_2039_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1120_2039_Closed_Text.style.display='none'; Codehighlighter1_1120_2039_Open_Image.style.display='inline'; Codehighlighter1_1120_2039_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span>
						<span id="Codehighlighter1_1120_2039_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_1120_2039_Open_Text">
								<span style="COLOR: #000000">{    <br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span>
								<span style="COLOR: #0000ff">if</span>
								<span style="COLOR: #000000">( </span>
								<span style="COLOR: #000000">'</span>
								<span style="COLOR: #000000">\</span>
								<span style="COLOR: #000000">''</span>
								<span style="COLOR: #000000"> != *beg &amp;&amp; </span>
								<span style="COLOR: #000000">'</span>
								<span style="COLOR: #000000">,</span>
								<span style="COLOR: #000000">'</span>
								<span style="COLOR: #000000"> != *beg)</span>
								<span style="COLOR: #000000">
										<br />
										<img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />
								</span>
								<span style="COLOR: #000000">            tmpStr.push_back(</span>
								<span style="COLOR: #000000">*</span>
								<span style="COLOR: #000000">beg);<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span>
								<span style="COLOR: #0000ff">else</span>
								<span style="COLOR: #000000"> </span>
								<span style="COLOR: #0000ff">if</span>
								<span style="COLOR: #000000">(</span>
								<span style="COLOR: #000000">'</span>
								<span style="COLOR: #000000">,</span>
								<span style="COLOR: #000000">'</span>
								<span style="COLOR: #000000"> </span>
								<span style="COLOR: #000000">==</span>
								<span style="COLOR: #000000"> </span>
								<span style="COLOR: #000000">*</span>
								<span style="COLOR: #000000">beg)<br /><img id="Codehighlighter1_1241_1320_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1241_1320_Open_Text.style.display='none'; Codehighlighter1_1241_1320_Closed_Image.style.display='inline'; Codehighlighter1_1241_1320_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1241_1320_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1241_1320_Closed_Text.style.display='none'; Codehighlighter1_1241_1320_Open_Image.style.display='inline'; Codehighlighter1_1241_1320_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />        </span>
								<span id="Codehighlighter1_1241_1320_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_1241_1320_Open_Text">
										<span style="COLOR: #000000">{<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />            container.push_back(tmpStr);<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />            tmpStr.clear();<br /><img src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span>
								</span>
								<span style="COLOR: #000000">
										<br />
										<img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span>
								<span style="COLOR: #0000ff">else</span>
								<span style="COLOR: #000000"> </span>
								<span style="COLOR: #0000ff">if</span>
								<span style="COLOR: #000000">(</span>
								<span style="COLOR: #000000">'</span>
								<span style="COLOR: #000000">\</span>
								<span style="COLOR: #000000">''</span>
								<span style="COLOR: #000000"> == *beg)</span>
								<span style="COLOR: #000000">
										<br />
										<img id="Codehighlighter1_1361_2032_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1361_2032_Open_Text.style.display='none'; Codehighlighter1_1361_2032_Closed_Image.style.display='inline'; Codehighlighter1_1361_2032_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" />
										<img id="Codehighlighter1_1361_2032_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1361_2032_Closed_Text.style.display='none'; Codehighlighter1_1361_2032_Open_Image.style.display='inline'; Codehighlighter1_1361_2032_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />
								</span>
								<span style="COLOR: #000000">        </span>
								<span id="Codehighlighter1_1361_2032_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_1361_2032_Open_Text">
										<span style="COLOR: #000000">{<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span>
										<span style="COLOR: #0000ff">int</span>
										<span style="COLOR: #000000"> first </span>
										<span style="COLOR: #000000">=</span>
										<span style="COLOR: #000000"> toInt(tmpStr);<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span>
										<span style="COLOR: #0000ff">int</span>
										<span style="COLOR: #000000"> last </span>
										<span style="COLOR: #000000">=</span>
										<span style="COLOR: #000000"> </span>
										<span style="COLOR: #000000">0</span>
										<span style="COLOR: #000000">;<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />            tmpStr.clear();<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span>
										<span style="COLOR: #000000">++</span>
										<span style="COLOR: #000000">beg;<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span>
										<span style="COLOR: #008000">//</span>
										<span style="COLOR: #008000">此处可以用一个flag来标记读到的是符号 ' 左边还是右边的数<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span>
										<span style="COLOR: #008000">//</span>
										<span style="COLOR: #008000">这样就可以不用嵌套while循环找int last了<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span>
										<span style="COLOR: #008000">//</span>
										<span style="COLOR: #008000">为了方便理解，多用一个while，时间复杂度没怎么增加 </span>
										<span style="COLOR: #008000">
												<br />
												<img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />
										</span>
										<span style="COLOR: #000000">            </span>
										<span style="COLOR: #0000ff">while</span>
										<span style="COLOR: #000000">(</span>
										<span style="COLOR: #000000">'</span>
										<span style="COLOR: #000000">,</span>
										<span style="COLOR: #000000">'</span>
										<span style="COLOR: #000000"> </span>
										<span style="COLOR: #000000">!=</span>
										<span style="COLOR: #000000"> </span>
										<span style="COLOR: #000000">*</span>
										<span style="COLOR: #000000">beg </span>
										<span style="COLOR: #000000">&amp;&amp;</span>
										<span style="COLOR: #000000"> beg </span>
										<span style="COLOR: #000000">!=</span>
										<span style="COLOR: #000000"> end)<br /><img id="Codehighlighter1_1662_1739_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1662_1739_Open_Text.style.display='none'; Codehighlighter1_1662_1739_Closed_Image.style.display='inline'; Codehighlighter1_1662_1739_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1662_1739_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1662_1739_Closed_Text.style.display='none'; Codehighlighter1_1662_1739_Open_Image.style.display='inline'; Codehighlighter1_1662_1739_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />            </span>
										<span id="Codehighlighter1_1662_1739_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_1662_1739_Open_Text">
												<span style="COLOR: #000000">{<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />                tmpStr.push_back(</span>
												<span style="COLOR: #000000">*</span>
												<span style="COLOR: #000000">beg);<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />                </span>
												<span style="COLOR: #000000">++</span>
												<span style="COLOR: #000000">beg;<br /><img src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />            }</span>
										</span>
										<span style="COLOR: #000000">
												<br />
												<img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />                <br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />            last </span>
										<span style="COLOR: #000000">=</span>
										<span style="COLOR: #000000"> toInt(tmpStr);<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />            tmpStr.clear(); <br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span>
										<span style="COLOR: #008000">//</span>
										<span style="COLOR: #008000">把符号 ' 分开的两个数字展开。<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span>
										<span style="COLOR: #008000">//</span>
										<span style="COLOR: #008000">例如12'15展开成12 13 14 15,<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span>
										<span style="COLOR: #008000">//</span>
										<span style="COLOR: #008000">将展开后的数字转换成字符按照顺序放到container里面 </span>
										<span style="COLOR: #008000">
												<br />
												<img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />
										</span>
										<span style="COLOR: #000000">            </span>
										<span style="COLOR: #0000ff">for</span>
										<span style="COLOR: #000000">(</span>
										<span style="COLOR: #0000ff">int</span>
										<span style="COLOR: #000000"> i</span>
										<span style="COLOR: #000000">=</span>
										<span style="COLOR: #000000">first; i</span>
										<span style="COLOR: #000000">&lt;=</span>
										<span style="COLOR: #000000">last; </span>
										<span style="COLOR: #000000">++</span>
										<span style="COLOR: #000000">i)<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />                container.push_back(toStr(i));<br /><img src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span>
								</span>
								<span style="COLOR: #000000"> <br /><img src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span>
						</span>
						<span style="COLOR: #000000">
								<br />
								<img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span>
						<span style="COLOR: #0000ff">if</span>
						<span style="COLOR: #000000">(</span>
						<span style="COLOR: #000000">!</span>
						<span style="COLOR: #000000">tmpStr.empty())<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />        container.push_back(tmpStr);<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />    <br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span>
						<span style="COLOR: #008000">//</span>
						<span style="COLOR: #008000">生成最终展开的结果字符串 </span>
						<span style="COLOR: #008000">
								<br />
								<img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />
						</span>
						<span style="COLOR: #000000">    </span>
						<span style="COLOR: #0000ff">for</span>
						<span style="COLOR: #000000">(vector</span>
						<span style="COLOR: #000000">&lt;</span>
						<span style="COLOR: #0000ff">string</span>
						<span style="COLOR: #000000">&gt;</span>
						<span style="COLOR: #000000">::iterator iter </span>
						<span style="COLOR: #000000">=</span>
						<span style="COLOR: #000000"> container.begin();<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />        iter </span>
						<span style="COLOR: #000000">!=</span>
						<span style="COLOR: #000000"> container.end();<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span>
						<span style="COLOR: #000000">++</span>
						<span style="COLOR: #000000">iter)<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />        afterStr </span>
						<span style="COLOR: #000000">=</span>
						<span style="COLOR: #000000"> afterStr </span>
						<span style="COLOR: #000000">+</span>
						<span style="COLOR: #000000"> head </span>
						<span style="COLOR: #000000">+</span>
						<span style="COLOR: #000000"> </span>
						<span style="COLOR: #000000">*</span>
						<span style="COLOR: #000000">iter </span>
						<span style="COLOR: #000000">+</span>
						<span style="COLOR: #000000"> </span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000"> </span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">;<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />        <br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span>
						<span style="COLOR: #0000ff">return</span>
						<span style="COLOR: #000000"> afterStr </span>
						<span style="COLOR: #000000">+</span>
						<span style="COLOR: #000000"> </span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">\n</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">;<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" />
						<br />
						<img src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align="top" />
						<br />
						<img src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align="top" />
				</span>
				<span style="COLOR: #0000ff">int</span>
				<span style="COLOR: #000000"> toInt(</span>
				<span style="COLOR: #0000ff">const</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #0000ff">string</span>
				<span style="COLOR: #000000">&amp;</span>
				<span style="COLOR: #000000"> str)<br /><img id="Codehighlighter1_2356_2449_Open_Image" onclick="this.style.display='none'; Codehighlighter1_2356_2449_Open_Text.style.display='none'; Codehighlighter1_2356_2449_Closed_Image.style.display='inline'; Codehighlighter1_2356_2449_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_2356_2449_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_2356_2449_Closed_Text.style.display='none'; Codehighlighter1_2356_2449_Open_Image.style.display='inline'; Codehighlighter1_2356_2449_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span>
				<span id="Codehighlighter1_2356_2449_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_2356_2449_Open_Text">
						<span style="COLOR: #000000">{<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span>
						<span style="COLOR: #0000ff">int</span>
						<span style="COLOR: #000000"> integer;<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />    stringstream tmp;<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />    tmp</span>
						<span style="COLOR: #000000">&lt;&lt;</span>
						<span style="COLOR: #000000">str;<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />    tmp</span>
						<span style="COLOR: #000000">&gt;&gt;</span>
						<span style="COLOR: #000000">integer;<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span>
						<span style="COLOR: #0000ff">return</span>
						<span style="COLOR: #000000"> integer;<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" />
						<br />
						<img src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align="top" />
				</span>
				<span style="COLOR: #0000ff">string</span>
				<span style="COLOR: #000000"> toStr(</span>
				<span style="COLOR: #0000ff">const</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #0000ff">int</span>
				<span style="COLOR: #000000"> integer)<br /><img id="Codehighlighter1_2484_2572_Open_Image" onclick="this.style.display='none'; Codehighlighter1_2484_2572_Open_Text.style.display='none'; Codehighlighter1_2484_2572_Closed_Image.style.display='inline'; Codehighlighter1_2484_2572_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_2484_2572_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_2484_2572_Closed_Text.style.display='none'; Codehighlighter1_2484_2572_Open_Image.style.display='inline'; Codehighlighter1_2484_2572_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span>
				<span id="Codehighlighter1_2484_2572_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_2484_2572_Open_Text">
						<span style="COLOR: #000000">{<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span>
						<span style="COLOR: #0000ff">string</span>
						<span style="COLOR: #000000"> str;<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />    stringstream tmp;<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />    tmp</span>
						<span style="COLOR: #000000">&lt;&lt;</span>
						<span style="COLOR: #000000">integer;<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />    tmp</span>
						<span style="COLOR: #000000">&gt;&gt;</span>
						<span style="COLOR: #000000">str;<br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span>
						<span style="COLOR: #0000ff">return</span>
						<span style="COLOR: #000000"> str;<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/stan/aggbug/15268.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/stan/" target="_blank">The Humble Programmer</a> 2006-11-16 23:22 <a href="http://www.cppblog.com/stan/archive/2006/11/16/15268.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[原创]银行家算法源代码</title><link>http://www.cppblog.com/stan/archive/2006/11/14/15161.html</link><dc:creator>The Humble Programmer</dc:creator><author>The Humble Programmer</author><pubDate>Tue, 14 Nov 2006 15:45:00 GMT</pubDate><guid>http://www.cppblog.com/stan/archive/2006/11/14/15161.html</guid><wfw:comment>http://www.cppblog.com/stan/comments/15161.html</wfw:comment><comments>http://www.cppblog.com/stan/archive/2006/11/14/15161.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cppblog.com/stan/comments/commentRss/15161.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/stan/services/trackbacks/15161.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: //				实现了“银行家算法”的三个部分。初始化、安全检查、申请资源				//				author:Stanley 																																				#include 				&lt;				iostream				&gt;																#include 				&lt;...&nbsp;&nbsp;<a href='http://www.cppblog.com/stan/archive/2006/11/14/15161.html'>阅读全文</a><img src ="http://www.cppblog.com/stan/aggbug/15161.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/stan/" target="_blank">The Humble Programmer</a> 2006-11-14 23:45 <a href="http://www.cppblog.com/stan/archive/2006/11/14/15161.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>终于把QT给安装好了</title><link>http://www.cppblog.com/stan/archive/2006/11/07/14830.html</link><dc:creator>The Humble Programmer</dc:creator><author>The Humble Programmer</author><pubDate>Tue, 07 Nov 2006 15:51:00 GMT</pubDate><guid>http://www.cppblog.com/stan/archive/2006/11/07/14830.html</guid><wfw:comment>http://www.cppblog.com/stan/comments/14830.html</wfw:comment><comments>http://www.cppblog.com/stan/archive/2006/11/07/14830.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/stan/comments/commentRss/14830.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/stan/services/trackbacks/14830.html</trackback:ping><description><![CDATA[
		<font size="2">做OpenGL应用，嫌做出来界面不好看。<br />于是想试试QT。<br />宿舍不能上外网，用代理超级慢的速度把QT4下载了。<br />然后突然发现没装MingGW。<br />又是上外网，又是上外网！<br />后来实在不行了，下了个DEV-C++，用里面绑定的MingGW。<br />呼，今天就到这里了。明天再接着玩。<br /><br />OpenGL其实不难，这几天熟悉一下。<br />慢慢来，慢慢来。<br />就当是再为咱国家的航空事业做贡献……<br />（嘻嘻，细节保密）</font>
<img src ="http://www.cppblog.com/stan/aggbug/14830.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/stan/" target="_blank">The Humble Programmer</a> 2006-11-07 23:51 <a href="http://www.cppblog.com/stan/archive/2006/11/07/14830.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>