<?xml version="1.0" encoding="utf-8" ?>
<!-- generator="FEEDCREATOR_VERSION" -->
<rss version="2.0" xmlns:sns="http://blog.sina.com.cn/sns">
    <channel>
        <title>游侠UFO工作室</title>
        <description></description>
        <link>http://blog.sina.com.cn/ufownl</link>
        <lastBuildDate>Wed, 02 Dec 2009 07:56:29 GMT+8</lastBuildDate>
        <generator>FEEDCREATOR_VERSION</generator>
        <language>zh-cn</language>
        <copyright>Copyright 1996 - 2009 SINA Inc. All Rights Reserved.</copyright>
        <pubDate>Tue, 01 Dec 2009 23:56:29 GMT+8</pubDate>
        <item>
            <title>队列(面向对象程序设计训练)</title>
            <link>http://blog.sina.com.cn/s/blog_4033131f01008gd4.html</link>
            <description><![CDATA[<div>
<p>template &lt;typename DataType&gt;</P>
<p>class QueueClass</P>
<p>{</P>
<p>private:</P>
<p>&nbsp;&nbsp;&nbsp; struct
BodyNodeStruct</P>
<p>&nbsp;&nbsp;&nbsp; {</P>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
DataType Data;</P>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BodyNodeStruct *Pre,*Next;</P>
<p>&nbsp;&nbsp;&nbsp; }
*Front,*Rear;</P>
<p>&nbsp;</P>
<p>public:</P>
<p>&nbsp;&nbsp;&nbsp;
QueueClass();&nbsp; //构造函数。</P>
<p>&nbsp;&nbsp;&nbsp; bool
Empty();&nbsp;
//判断队列是否为空，若为空则返回true，否则返回false。</P>
<p>&nbsp;&nbsp;&nbsp; int
Push(DataType Data);&nbsp;
//将Data压入队尾，如果压入成功则返回0，否则返回1。</P>
<p>&nbsp;&nbsp;&nbsp; int
Pop(DataType &amp;Data);&nbsp;
//弹出队头元素，保存在Data中，若队列不为空则返回0，否则返回1。</P>
<p>&nbsp;&nbsp;&nbsp; int
GetFront(DataType &amp;Data);&nbsp;
//读取队头元素，保存在Data中，若队列不为空则返回0，否则返回1。</P>
<p>&nbsp;&nbsp;&nbsp; int
Size();&nbsp; //返回队列中元素个数。</P>
<p>&nbsp;&nbsp;&nbsp; void
Clear();&nbsp; //清空队列。</P>
<p>&nbsp;&nbsp;&nbsp;
~QueueClass();&nbsp; //析构函数。</P>
<p>} ;</P>
<p>&nbsp;</P>
<p>template &lt;typename DataType&gt;</P>
<p>QueueClass&lt;DataType&gt;::QueueClass()</P>
<p>{</P>
<p>&nbsp;&nbsp;&nbsp; Front=new
BodyNodeStruct;</P>
<p>&nbsp;&nbsp;&nbsp;
Front-&gt;Pre=NULL;</P>
<p>&nbsp;&nbsp;&nbsp;
Front-&gt;Next=NULL;</P>
<p>&nbsp;&nbsp;&nbsp;
Rear=Front;</P>
<p>}</P>
<p>&nbsp;</P>
<p>template &lt;typename DataType&gt;</P>
<p>bool QueueClass&lt;DataType&gt;::Empty()</P>
<p>{</P>
<p>&nbsp;&nbsp;&nbsp; if
(Front==Rear) return true;</P>
<p>&nbsp;&nbsp;&nbsp; else
return false;</P>
<p>}</P>
<p>&nbsp;</P>
<p>template &lt;typename DataType&gt;</P>
<p>int QueueClass&lt;DataType&gt;::Push(DataType Data)</P>
<p>{</P>
<p>&nbsp;&nbsp;&nbsp;
BodyNodeStruct *Temp=new BodyNodeStruct;</P>
<p>&nbsp;</P>
<p>&nbsp;&nbsp;&nbsp; if
(Temp!=NULL)</P>
<p>&nbsp;&nbsp;&nbsp; {</P>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Temp-&gt;Pre=Rear;</P>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Temp-&gt;Next=NULL;</P>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Rear-&gt;Next=Temp;</P>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Rear-&gt;Data=Data;</P>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Rear=Temp;</P>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
return 0;</P>
<p>&nbsp;&nbsp;&nbsp; }</P>
<p>&nbsp;&nbsp;&nbsp; else
return 1;</P>
<p>}</P>
<p>&nbsp;</P>
<p>template &lt;typename DataType&gt;</P>
<p>int QueueClass&lt;DataType&gt;::Pop(DataType &amp;Data)</P>
<p>{</P>
<p>&nbsp;&nbsp;&nbsp; if
(!Empty())</P>
<p>&nbsp;&nbsp;&nbsp; {</P>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Data=Front-&gt;Data;</P>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Front=Front-&gt;Next;</P>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
delete Front-&gt;Pre;</P>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Front-&gt;Pre=NULL;</P>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
return 0;</P>
<p>&nbsp;&nbsp;&nbsp; }</P>
<p>&nbsp;&nbsp;&nbsp; else
return 1;</P>
<p>}</P>
<p>&nbsp;</P>
<p>template &lt;typename DataType&gt;</P>
<p>int QueueClass&lt;DataType&gt;::GetFront(DataType &amp;Data)</P>
<p>{</P>
<p>&nbsp;&nbsp;&nbsp; if
(!Empty())</P>
<p>&nbsp;&nbsp;&nbsp; {</P>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Data=Front-&gt;Data;</P>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
return 0;</P>
<p>&nbsp;&nbsp;&nbsp; }</P>
<p>&nbsp;&nbsp;&nbsp; else
return 1;</P>
<p>}</P>
<p>&nbsp;</P>
<p>template &lt;typename DataType&gt;</P>
<p>int QueueClass&lt;DataType&gt;::Size()</P>
<p>{</P>
<p>&nbsp;&nbsp;&nbsp;
BodyNodeStruct *Temp=Front;</P>
<p>&nbsp;&nbsp;&nbsp; int
Count=0;</P>
<p>&nbsp;</P>
<p>&nbsp;&nbsp;&nbsp; while
(Temp!=Rear)</P>
<p>&nbsp;&nbsp;&nbsp; {</P>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Count++;</P>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Temp=Temp-&gt;Next;</P>
<p>&nbsp;&nbsp;&nbsp; }</P>
<p>&nbsp;&nbsp;&nbsp; return
Count;</P>
<p>}</P>
<p>&nbsp;</P>
<p>template &lt;typename DataType&gt;</P>
<p>void QueueClass&lt;DataType&gt;::Clear()</P>
<p>{</P>
<p>&nbsp;&nbsp;&nbsp; DataType
Temp;</P>
<p>&nbsp;</P>
<p>&nbsp;&nbsp;&nbsp; while
(!Empty()) Pop(Temp);</P>
<p>}</P>
<p>&nbsp;</P>
<p>template &lt;typename DataType&gt;</P>
<p>QueueClass&lt;DataType&gt;::~QueueClass()</P>
<p>{</P>
<p>&nbsp;&nbsp;&nbsp;
Clear();</P>
<p>&nbsp;&nbsp;&nbsp; delete
Front;</P>
}</DIV>
]]></description>
            <author>游侠UFO</author>
            <category>程序设计资料</category>
            <comments>http://blog.sina.com.cn/s/blog_4033131f01008gd4.html#comment</comments>
            <pubDate>Sun, 06 Jan 2008 03:22:58 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4033131f01008gd4.html</guid>
        </item>
        <item>
            <title>栈（面向对象程序设计训练）</title>
            <link>http://blog.sina.com.cn/s/blog_4033131f01008fxd.html</link>
            <description><![CDATA[<div>
<p STYLE="TEXT-INDENT: 2em">template &lt;typename DataType&gt;</P>
<p STYLE="TEXT-INDENT: 2em">class StackClass</P>
<p STYLE="TEXT-INDENT: 2em">{</P>
<p STYLE="TEXT-INDENT: 2em">private:</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp; struct
BodyNodeStruct</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp; {</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
DataType Data;</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
BodyNodeStruct *Pre,*Next;</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp; }
Bottom,*Top;</P>
<p STYLE="TEXT-INDENT: 2em">&nbsp;</P>
<p STYLE="TEXT-INDENT: 2em">public:</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp;
StackClass();&nbsp; //构造函数。</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp; bool
Empty();&nbsp;
//判断栈是否为空，若为空则返回true，否则返回false。</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp; int
Push(DataType Data);&nbsp;
//将Data压栈，如果压栈成功则返回0，否则返回1。</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp; int
Pop(DataType &amp;Data);&nbsp;
//弹出栈顶元素，保存在Data中，若栈不为空则返回0，否则返回1。</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp; int
GetTop(DataType &amp;Data);&nbsp;
//读取栈顶元素，保存在Data中，若栈不为空则返回0，否则返回1。</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp; int
Size();&nbsp; //返回栈中元素个数</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp; void
Clear();&nbsp; //清空栈</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp;
~StackClass();&nbsp; //析构函数</P>
<p STYLE="TEXT-INDENT: 2em">} ;</P>
<p STYLE="TEXT-INDENT: 2em">&nbsp;</P>
<p STYLE="TEXT-INDENT: 2em">template &lt;typename DataType&gt;</P>
<p STYLE="TEXT-INDENT: 2em">
StackClass&lt;DataType&gt;::StackClass()</P>
<p STYLE="TEXT-INDENT: 2em">{</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp;
Top=&amp;Bottom;</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp;
Top-&gt;Pre=NULL;</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp;
Top-&gt;Next=NULL;</P>
<p STYLE="TEXT-INDENT: 2em">}</P>
<p STYLE="TEXT-INDENT: 2em">&nbsp;</P>
<p STYLE="TEXT-INDENT: 2em">template &lt;typename DataType&gt;</P>
<p STYLE="TEXT-INDENT: 2em">bool
StackClass&lt;DataType&gt;::Empty()</P>
<p STYLE="TEXT-INDENT: 2em">{</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp; if
(Top==&amp;Bottom) return true;</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp; else return
false;</P>
<p STYLE="TEXT-INDENT: 2em">}</P>
<p STYLE="TEXT-INDENT: 2em">&nbsp;</P>
<p STYLE="TEXT-INDENT: 2em">template &lt;typename DataType&gt;</P>
<p STYLE="TEXT-INDENT: 2em">int
StackClass&lt;DataType&gt;::Push(DataType Data)</P>
<p STYLE="TEXT-INDENT: 2em">{</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp;
BodyNodeStruct *Temp=new BodyNodeStruct;</P>
<p STYLE="TEXT-INDENT: 2em">&nbsp;</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp; if
(Temp!=NULL)</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp; {</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Temp-&gt;Pre=Top;</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Temp-&gt;Next=NULL;</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Top-&gt;Next=Temp;</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Top-&gt;Data=Data;</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Top=Temp;</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
return 0;</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp; }</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp; else return
1;</P>
<p STYLE="TEXT-INDENT: 2em">}</P>
<p STYLE="TEXT-INDENT: 2em">&nbsp;</P>
<p STYLE="TEXT-INDENT: 2em">template &lt;typename DataType&gt;</P>
<p STYLE="TEXT-INDENT: 2em">int
StackClass&lt;DataType&gt;::Pop(DataType &amp;Data)</P>
<p STYLE="TEXT-INDENT: 2em">{</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp; if
(!Empty())</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp; {</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Top=Top-&gt;Pre;</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Data=Top-&gt;Data;</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
delete Top-&gt;Next;</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Top-&gt;Next=NULL;</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
return 0;</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp; }</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp; else return
1;</P>
<p STYLE="TEXT-INDENT: 2em">}</P>
<p STYLE="TEXT-INDENT: 2em">&nbsp;</P>
<p STYLE="TEXT-INDENT: 2em">template &lt;typename DataType&gt;</P>
<p STYLE="TEXT-INDENT: 2em">int
StackClass&lt;DataType&gt;::GetTop(DataType &amp;Data)</P>
<p STYLE="TEXT-INDENT: 2em">{</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp; if
(!Empty())</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp; {</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Data=Top-&gt;Pre-&gt;Data;</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
return 0;</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp; }</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp; else return
1;</P>
<p STYLE="TEXT-INDENT: 2em">}</P>
<p STYLE="TEXT-INDENT: 2em">&nbsp;</P>
<p STYLE="TEXT-INDENT: 2em">template &lt;typename DataType&gt;</P>
<p STYLE="TEXT-INDENT: 2em">int
StackClass&lt;DataType&gt;::Size()</P>
<p STYLE="TEXT-INDENT: 2em">{</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp;
BodyNodeStruct *Temp=&amp;Bottom;</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp; int
Count=0;</P>
<p STYLE="TEXT-INDENT: 2em">&nbsp;</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp; while
(Temp!=Top)</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp; {</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Count++;</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Temp=Temp-&gt;Next;</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp; }</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp; return
Count;</P>
<p STYLE="TEXT-INDENT: 2em">}</P>
<p STYLE="TEXT-INDENT: 2em">&nbsp;</P>
<p STYLE="TEXT-INDENT: 2em">template &lt;typename DataType&gt;</P>
<p STYLE="TEXT-INDENT: 2em">void
StackClass&lt;DataType&gt;::Clear()</P>
<p STYLE="TEXT-INDENT: 2em">{</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp; DataType
Temp;</P>
<p STYLE="TEXT-INDENT: 2em">&nbsp;</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp; while
(!Empty()) Pop(Temp);</P>
<p STYLE="TEXT-INDENT: 2em">}</P>
<p STYLE="TEXT-INDENT: 2em">&nbsp;</P>
<p STYLE="TEXT-INDENT: 2em">template &lt;typename DataType&gt;</P>
<p STYLE="TEXT-INDENT: 2em">
StackClass&lt;DataType&gt;::~StackClass()</P>
<p STYLE="TEXT-INDENT: 2em">{</P>
<p STYLE="TEXT-INDENT: 2em">
&nbsp;&nbsp;&nbsp; Clear();</P>
<p STYLE="TEXT-INDENT: 2em">}</P>
</DIV>
]]></description>
            <author>游侠UFO</author>
            <category>程序设计资料</category>
            <comments>http://blog.sina.com.cn/s/blog_4033131f01008fxd.html#comment</comments>
            <pubDate>Fri, 04 Jan 2008 11:51:07 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4033131f01008fxd.html</guid>
        </item>
        <item>
            <title>期末考试的第二科圆满结束</title>
            <link>http://blog.sina.com.cn/s/blog_4033131f01008fu8.html</link>
            <description><![CDATA[<div>&nbsp;
<p>&nbsp;&nbsp;&nbsp;
今天下午考试期末考试的第二科——《计算机基本技能训练》，说白了就是OFFICE及WINDOWS基本操作。这个对我来说应该是极其小儿科的事了。</P>
<p>&nbsp;&nbsp;&nbsp;
试卷发下来一看，两道题目：第一题是在WORD里面整张表格，第二题是一些基本的文件操作，时间一个小时。看完的第一个想法就是这个居然要一个小时，半个小时都多了点。第二个想法就是，做表格在WORD里面做，除非那个人不会EXCEL。很显然的问题，用EXCEL做表格要比直接在WORD里面做方便得多。先在EXCEL里面把表做好，直接选中“Ctrl+C”-&gt;“Ctrl+V”就搞定了，最多贴过来再改下格式。按照上面的思路，三下五除二，第一题搞定。然后是第二题，在E盘建个文件，设置属性为只读，复制五份，在资源管理器中直接拖到D盘。第二题更没难度嘛，很快就搞定，然后老师下来打成绩，毫无悬念的满分。这时看下时间，考试刚好过去20分钟。</P>
</DIV>
]]></description>
            <author>游侠UFO</author>
            <category>其它</category>
            <comments>http://blog.sina.com.cn/s/blog_4033131f01008fu8.html#comment</comments>
            <pubDate>Fri, 04 Jan 2008 07:38:15 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4033131f01008fu8.html</guid>
        </item>
        <item>
            <title>朋友手机丢了:-(</title>
            <link>http://blog.sina.com.cn/s/blog_4033131f01008e4p.html</link>
            <description><![CDATA[<div>
<p>&nbsp;&nbsp;
今天下午，正在写程序，顺便整理磁盘碎片(弄了一个下午，郁闷死)。然后耳机中响起了QQ那熟悉的“嘀嘀”声。习惯性的“Ctrl”+“Alt”+“Z”，弹出聊天窗口。一看，是很久没见的朋友，寒碜了几句，得知她手机丢了。我就说咋最近联系不上了-_-!。&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</P>
<p>&nbsp;&nbsp;&nbsp;
回想高三暑假，我在一次乘车上车时手机被“摸”，由于发现及时以及采取一定措施给找了回来；而前段时间，我的自行车锁被撬，由于运气很好，没被撬开，也被我侥幸找了回来（具体情况见《今天幸运啊，车只是差点被偷》）。不过，我这朋友就没这么幸运了……为什么我的好运没带给我的朋友们呢？</P>
<p>&nbsp;&nbsp;&nbsp;
总的来说，出门在外还是小心一点好啊。最后，预祝大家新年快乐！o(∩_∩)o...</P>
</DIV>
]]></description>
            <author>游侠UFO</author>
            <category>其它</category>
            <comments>http://blog.sina.com.cn/s/blog_4033131f01008e4p.html#comment</comments>
            <pubDate>Sun, 30 Dec 2007 14:04:22 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4033131f01008e4p.html</guid>
        </item>
        <item>
            <title>环仙海湖骑行</title>
            <link>http://blog.sina.com.cn/s/blog_4033131f01008bpn.html</link>
            <description><![CDATA[<p>如看不到图片就到这里：<a HREF="http://ufownl.blog.163.com/blog/static/125012220071123104020212/"><font FACE="宋体">http://ufownl.blog.163.com/blog/static/125012220071123104020212/</FONT></A></P>
<p><a HREF="http://img.blog.163.com/photo/BTZe-5pcRX9Ov4CZtIBpTA==/3948530973297410892.jpg" TARGET="_blank"></A>&nbsp;</P>
<p>&nbsp;&nbsp;&nbsp;
本来准备昨天出发的，但是昨天雾太大，能见度暴低，考虑到骑行安全问题未能成行。于是推迟，正好集训队这周没集体安排，所以就推迟到今天了，呵呵。不过天气也不太理想，还是雾蒙蒙的。</P>
<p>&nbsp;&nbsp;&nbsp;
上午九点十多分，和同行的人（WY-一个爱好运动的MM<img SRC="http://st.blog.163.com/style/common/htmlEditor/portrait/face/preview/face0.gif"></IMG>）从学校出发。干完一些杂七杂八的诸如租自行车（我是自带，呵呵）及买东西的事（差不多九点四十左右)，向着绵阳市区前进。首先取道长虹大道，上剑南路西段，通过东方红大桥，到剑南路东段，然后上绵梓公路(108国道)。跟着上次去仙海的路线，一切进行的很顺利（中途在博物馆作短暂停留）。</P>
<p><a HREF="http://img.blog.163.com/photo/uSOZbXi1NzZrrTSOYzYoAg==/2833608590546615484.jpg" TARGET="_blank"><img SRC="http://img.blog.163.com/photo/uSOZbXi1NzZrrTSOYzYoAg==/2833608590546615484.jpg"></IMG></A></P>
<p>绵阳博物馆，明年5.1开放</P>
<p><a HREF="http://img.blog.163.com/photo/u5mfmyPDrVoNAgMjPdg7wA==/2833608590546615673.jpg" TARGET="_blank"><img SRC="http://img.blog.163.com/photo/u5mfmyPDrVoNAgMjPdg7wA==/2833608590546615673.jpg"></IMG></A></P>
<p>绵梓公路的一个很长的上坡上休息时拍的</P>
<p>&nbsp;&nbsp;&nbsp;
经过21公里、两个多小时的骑行我们终于到达仙海风景区大门。如果我一人21公里一个小时完全够了，不过由于WY体力问题加上租来的车性能方面的问题，在路上多次休息，导致花了平时两倍的时间（所以出去玩还是骑自己的车好啊，租来的始终不爽）。</P>
<p><a HREF="http://img.blog.163.com/photo/las_i3qAYXH9hdJKcSQfUA==/3947968023343989746.jpg" TARGET="_blank"><img SRC="http://img.blog.163.com/photo/las_i3qAYXH9hdJKcSQfUA==/3947968023343989746.jpg"></IMG></A></P>
<p>仙海风景区大门</P>
<p>&nbsp;&nbsp;&nbsp;
进入仙海风景区（又爬了一坡。。），已经是12点一刻了，我们在一家小吃点一人吃了碗饺子后开始了环湖之旅。</P>
<p><a HREF="http://img.blog.163.com/photo/ViqtQrE95L3SDFkE-WOD4Q==/3948530973297410663.jpg" TARGET="_blank"><img SRC="http://img.blog.163.com/photo/ViqtQrE95L3SDFkE-WOD4Q==/3948530973297410663.jpg"></IMG></A><a HREF="http://img.blog.163.com/photo/izJ_FLEHUOp9mUinVtPIcA==/3662833871936057877.jpg" TARGET="_blank"><img SRC="http://img.blog.163.com/photo/izJ_FLEHUOp9mUinVtPIcA==/3662833871936057877.jpg"></IMG></A></P>
<p>雾中的仙海（是否有种仙境的感觉呢？）</P>
<p><a HREF="http://img.blog.163.com/photo/GXP33Ggs6AC2WdsxJWn3cw==/604608249974789983.jpg" TARGET="_blank"><img SRC="http://img.blog.163.com/photo/GXP33Ggs6AC2WdsxJWn3cw==/604608249974789983.jpg"></IMG></A><a HREF="http://img.blog.163.com/photo/fJcsFSlX-bYP-90RzqXPRA==/1728537831980630386.jpg" TARGET="_blank"><img SRC="http://img.blog.163.com/photo/fJcsFSlX-bYP-90RzqXPRA==/1728537831980630386.jpg"></IMG></A></P>
<p>环湖路上景点（古驿道）</P>
<p STYLE="TEXT-INDENT: 2em"><a HREF="http://img.blog.163.com/photo/PuAy09KnvwmOTk65JgBEDw==/604608249974790095.jpg" TARGET="_blank"><img SRC="http://img.blog.163.com/photo/PuAy09KnvwmOTk65JgBEDw==/604608249974790095.jpg"></IMG></A></P>
<p STYLE="TEXT-INDENT: 2em">狭窄（相对绵梓公路<img SRC="http://st.blog.163.com/style/common/htmlEditor/portrait/face/preview/face5.gif"></IMG>）的环湖路(弯道多的地方颇有“头文字D”的感觉)</P>
<p STYLE="TEXT-INDENT: 2em"><a HREF="http://img.blog.163.com/photo/cRQ25MCt3XKwKLmbr1AKQQ==/638103772203527587.jpg" TARGET="_blank"><img SRC="http://img.blog.163.com/photo/cRQ25MCt3XKwKLmbr1AKQQ==/638103772203527587.jpg"></IMG></A></P>
<p STYLE="TEXT-INDENT: 2em">
我们铁驴(羡慕环湖路上那些骑好车的朋友啊<img SRC="http://st.blog.163.com/style/common/htmlEditor/portrait/face/preview/face9.gif"></IMG>)<a HREF="http://img.blog.163.com/photo/veFSLEyi_z3DhaASJOZQZA==/638103772203527667.jpg" TARGET="_blank"><img SRC="http://img.blog.163.com/photo/veFSLEyi_z3DhaASJOZQZA==/638103772203527667.jpg"></IMG></A><a HREF="http://img.blog.163.com/photo/GI162WQMuVC1YlapMRPe3Q==/604608249974790250.jpg" TARGET="_blank"><img SRC="http://img.blog.163.com/photo/GI162WQMuVC1YlapMRPe3Q==/604608249974790250.jpg"></IMG></A></P>
<p STYLE="TEXT-INDENT: 2em">再来两张雾中仙海</P>
<p STYLE="TEXT-INDENT: 2em">
下午3点过，环湖结束回到中午吃饭的地方，稍作休息后于是开始往回走了。休息过程中又看到几辆好车啊<img SRC="http://st.blog.163.com/style/common/htmlEditor/portrait/face/preview/face9.gif"></IMG>。离开仙海的时候大概是三点半，同样经过两个小时的骑行，于五点半平安抵达学校。这样，我的第二次仙海行圆满结束了！<img SRC="http://st.blog.163.com/style/common/htmlEditor/portrait/face/preview/face5.gif"></IMG></P>
]]></description>
            <author>游侠UFO</author>
            <category>其它</category>
            <comments>http://blog.sina.com.cn/s/blog_4033131f01008bpn.html#comment</comments>
            <pubDate>Sun, 23 Dec 2007 14:41:24 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4033131f01008bpn.html</guid>
        </item>
        <item>
            <title>文字版大富翁</title>
            <link>http://blog.sina.com.cn/s/blog_4033131f01008a9u.html</link>
            <description><![CDATA[<div>
&nbsp;&nbsp;&nbsp;&nbsp;
由于新浪发表文章的长度有限制，下面只有一部分，完整版在网易BLOG。下面是链接：<a HREF="http://ufownl.blog.163.com/blog/static/12501222007111961522786/"><font FACE="宋体">http://ufownl.blog.163.com/blog/static/12501222007111961522786/</FONT></A></DIV>
<div>&nbsp;</DIV>
<div>
<p>&nbsp;&nbsp;&nbsp;
前段时间无聊，编了个游戏。不过由于新浪发不了这么长的文章，所以发到这里来了。</P>
<p>&nbsp;</P>
<p>#include &lt;stdio.h&gt;<br/>
#include &lt;conio.h&gt;<br/>
#include &lt;stdlib.h&gt;<br/>
#include &lt;string.h&gt;<br/>
#include &lt;windows.h&gt;<br/>
#include &lt;time.h&gt;</P>
<p>//地图尺寸<br/>
#define SIZE 42<br/>
//总玩家数目<br/>
#define COUNT 5<br/>
//幸运卡片数目<br/>
#define CARD 5<br/>
//起始现金数<br/>
#define StartCash 10000<br/>
//起始存款数<br/>
#define StartDeposit 10000<br/>
//银行位置<br/>
#define BANK 0<br/>
//抽取幸运卡片的位置<br/>
#define LUCK 20</P>
<p>struct PlayerType<br/>
{<br/>
&nbsp;char Name[10];<br/>
&nbsp;int Pos,State;<br/>
&nbsp;long Cash,Deposit;<br/>
} ;</P>
<p>struct MapType<br/>
{<br/>
&nbsp;char Name[10];<br/>
&nbsp;int Holder,Price,Count;<br/>
} ;</P>
<p>struct CardType<br/>
{<br/>
&nbsp;char Action[256];<br/>
&nbsp;int Prize;<br/>
} ;</P>
<p>void Init(struct MapType Map[], struct PlayerType Player[],
struct CardType Card[])&nbsp;
//初始化地图、玩家、卡片信息<br/>
{<br/>
&nbsp;FILE *Input;<br/>
&nbsp;int i;</P>
<p>&nbsp;Input=fopen("Map.Info","r");<br/>
&nbsp;for (i=0;i&lt;=SIZE-1;i++)<br/>
&nbsp;{<br/>
&nbsp;&nbsp;fscanf(Input,"%s%d",Map[i].Name,&amp;Map[i].Price);<br/>

&nbsp;&nbsp;Map[i].Holder=0;<br/>
&nbsp;&nbsp;Map[i].Count=0;<br/>
&nbsp;}<br/>
&nbsp;fclose(Input);<br/>
&nbsp;Input=fopen("Player.Info","r");<br/>
&nbsp;for (i=0;i&lt;=COUNT-1;i++)<br/>
&nbsp;{<br/>
&nbsp;&nbsp;fscanf(Input,"%s",Player[i].Name);<br/>

&nbsp;&nbsp;Player[i].Cash=StartCash;<br/>
&nbsp;&nbsp;Player[i].Deposit=StartDeposit;<br/>

&nbsp;&nbsp;Player[i].Pos=rand()%SIZE;<br/>

&nbsp;&nbsp;Player[i].State=0;<br/>
&nbsp;}<br/>
&nbsp;fclose(Input);<br/>
&nbsp;Input=fopen("Card.Info","r");<br/>
&nbsp;for
(i=0;i&lt;=CARD-1;i++)&nbsp;fscanf(Input,"%s%d",Card[i].Action,&amp;Card[i].Prize);<br/>

&nbsp;fclose(Input);<br/>
}</P>
<p>void ClearScreen()&nbsp; //清屏<br/>
{<br/>
&nbsp;system("cls");<br/>
}</P>
<p>void InputPlayerName(struct PlayerType Player[], int
PlayerCount)&nbsp; //输入玩家姓名<br/>
{<br/>
&nbsp;int i;</P>
<p>&nbsp;for (i=1;i&lt;=PlayerCount;i++)<br/>
&nbsp;{<br/>
&nbsp;&nbsp;printf("请输入%d号玩家的昵称:&gt;",i);<br/>

&nbsp;&nbsp;scanf("%s",Player[i].Name);<br/>

&nbsp;}<br/>
}</P>
<p>int Over(struct PlayerType Player[])&nbsp;
//判断是否游戏结束<br/>
{<br/>
&nbsp;int i,Count=0;</P>
<p>&nbsp;for (i=1;i&lt;=COUNT-1;i++)<br/>
&nbsp;&nbsp;if (Player[i].State==0)
Count++;<br/>
&nbsp;if (Count&lt;=1) return 1;<br/>
&nbsp;else return 0;<br/>
}</P>
<p>void Copy(char Str[], char</P>
</DIV>
]]></description>
            <author>游侠UFO</author>
            <category>自制程序</category>
            <comments>http://blog.sina.com.cn/s/blog_4033131f01008a9u.html#comment</comments>
            <pubDate>Wed, 19 Dec 2007 10:18:08 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4033131f01008a9u.html</guid>
        </item>
        <item>
            <title>格雷码</title>
            <link>http://blog.sina.com.cn/s/blog_4033131f010089z3.html</link>
            <description><![CDATA[<div>
<p ALIGN="center"><font COLOR="blue" SIZE="5">格雷码</FONT></P>
<p ALIGN="center">Time Limit:1000MS&nbsp; Memory
Limit:65536K<br/>
Total Submit:13 Accepted:11</P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Description</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">　在数字系统中只能识别0和1，各种数据要转换为二进制代码才能进行处理，格雷码是一种无权码，采用绝对编码方式，典型格雷码是一种具有反射特性和循环特性的单步自补码，它的循环、单步特性消除了随机取数时出现重大误差的可能，它的反射、自补特性使得求反非常方便。格雷码属于可靠性编码，是一种错误最小化的编码方式，因为，自然二进制码可以直接由数/模转换器转换成模拟信号，但某些情况，例如从十进制的3转换成4时二进制码的每一位都要变，使数字电路产生很大的尖峰电流脉冲。而格雷码则没有这一缺点，它是一种数字排序系统，其中的所有相邻整数在它们的数字表示中只有一个数字不同。它在任意两个相邻的数之间转换时，只有一个数位发生变化。它大大地减少了由一个状态到下一个状态时逻辑的混淆。另外由于最大数与最小数之间也仅一个数不同，故通常又叫雷反射码或循环码。下表为几种自然二进制码与格雷码的对照表：<br/>

<img STYLE="WIDTH: 500px; HEIGHT: 187px" SRC="http://acm.swust.edu.cn:8080/JudgeOnline/qupic/1331.jpg"></IMG></FONT><br/>

<br/>
二进制格雷码与自然二进制码的互换<br/>
1、自然二进制码转换成二进制格雷码<br/>
　自然二进制码转换成二进制格雷码，其法则是保留自然二进制码的最高位作为格雷码的最高位，而次高位格雷码为二进制码的高位与次高位相异或，而格雷码其余各位与次高位的求法相类似。<br/>

2、二进制格雷码转换成自然二进制码<br/>
　　二进制格雷码转换成自然二进制码,其法则是保留格雷码的最高位作为自然二进制码的最高位，而次高位自然二进制码为高位自然二进制码与次高位格雷码相异或，而自然二进制码的其余各位与次高位自然二进制码的求法相类似。<br/>
</P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Input</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">输入一个十进制整数M</FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Output</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">输出十进制整数M对应的格雷码</FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Sample
Input</FONT></B></P>
<pre>
<font FACE="Times New Roman" SIZE="3">2
13</FONT>
</PRE>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Sample
Output</FONT></B></P>
<pre>
<font FACE="Times New Roman" SIZE="3">11
1011</FONT>
</PRE>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Source</FONT></B></P>
<p ALIGN="left">&nbsp;</P>
<p><font FACE="宋体">#include &lt;iostream&gt;<br/>
#include &lt;string&gt;</FONT></P>
<p><font FACE="宋体">using namespace std;</FONT></P>
<p><font FACE="宋体">template &lt;typename DataType&gt;<br/>
string DecToN(DataType x, int n)<br/>
{<br/>
&nbsp;string Ans;<br/>
&nbsp;int Count,i,j=0,a[64];</FONT></P>
<p><font FACE="宋体">&nbsp;Count=0;<br/>
&nbsp;if (x==0)<br/>
&nbsp;{<br/>
&nbsp;&nbsp;Ans[0]='0';<br/>
&nbsp;&nbsp;Ans[1]='\0';<br/>
&nbsp;}<br/>
&nbsp;else<br/>
&nbsp;{<br/>
&nbsp;&nbsp;while (x&gt;0)<br/>
&nbsp;&nbsp;{<br/>
&nbsp;&nbsp;&nbsp;a[Count++]=x%n;<br/>

&nbsp;&nbsp;&nbsp;x=x/n;<br/>
&nbsp;&nbsp;}<br/>
&nbsp;&nbsp;for
(i=Count-1;i&gt;=0;i--)<br/>
&nbsp;&nbsp;&nbsp;if
(a[i]&lt;10) Ans.append(1,a[i]+'0');<br/>
&nbsp;&nbsp;&nbsp;else
Ans.append(1,a[i]+'A'-10);<br/>
&nbsp;}<br/>
&nbsp;return Ans;<br/>
}</FONT></P>
<p><font FACE="宋体">string BinToGray(const string &amp;Bin)<br/>
{<br/>
&nbsp;string Ans;<br/>
&nbsp;int i,Length;</FONT></P>
<p><font FACE="宋体">&nbsp;Ans.append(1,Bin[0]);<br/>
&nbsp;Length=int(Bin.length());<br/>
&nbsp;for (i=1;i&lt;=Length-1;i++)<br/>
&nbsp;&nbsp;if (Bin[i-1]!=Bin[i])
Ans.append(1,'1');<br/>
&nbsp;&nbsp;else Ans.append(1,'0');<br/>
&nbsp;return Ans;<br/>
}</FONT></P>
<p><font FACE="宋体">int main()<br/>
{<br/>
&nbsp;int Num;</FONT></P>
<p><font FACE="宋体">&nbsp;while (cin&gt;&gt;Num)
cout&lt;&lt;BinToGray(DecToN(Num,2))&lt;&lt;endl;<br/>
&nbsp;return 0;<br/>
}</FONT></P>
</DIV>
]]></description>
            <author>游侠UFO</author>
            <category>程序设计习题集</category>
            <comments>http://blog.sina.com.cn/s/blog_4033131f010089z3.html#comment</comments>
            <pubDate>Tue, 18 Dec 2007 14:42:45 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4033131f010089z3.html</guid>
        </item>
        <item>
            <title>寻找部分序列</title>
            <link>http://blog.sina.com.cn/s/blog_4033131f010089yz.html</link>
            <description><![CDATA[<div>
<p ALIGN="center"><font COLOR="blue" SIZE="5">寻找部分序列</FONT></P>
<p ALIGN="center">Time Limit:1000MS&nbsp; Memory
Limit:65536K<br/>
Total Submit:139 Accepted:17</P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Description</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">若s为一个字符串，把其中(任何位置)的字符去掉，留下的内容为s的一个子序列，也叫部分序列。例如：s为"abcdefg",
去掉b,d,f,剩下"aceg"；去掉a,b,c,剩下"defg"；于是"aceg","defg"都是字符串s的部分序列。请编程判断一个字符串是不是另一个的部分序列。</FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Input</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">输入两行：(输入的字符串均不为空字符串，且长度都不大于255)<br/>
第一行为字符串s。<br/>
第二行为一个字符串p。<br/>
判断p是不是s的一个部分序列。<br/></FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Output</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">如果p不是s的部分序列，输出No；如果是，则输出两行，第一行为Yes，第二行为字符串p中各个字符在s中的序号(从1开始)。</FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Sample
Input</FONT></B></P>
<pre>
<font FACE="Times New Roman" SIZE="3">aabbccdd
abc

abcdefg
agh</FONT>
</PRE>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Sample
Output</FONT></B></P>
<pre>
<font FACE="Times New Roman" SIZE="3">Yes
1 3 5
(注意不能是1 3 5以外的，比如2 3 5， 1 4 6等，也即是最左边匹配的部分序列的序号,本句不输出，呵呵~~~)
No</FONT>
</PRE>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Source</FONT></B></P>
<p ALIGN="left">&nbsp;</P>
<p><font FACE="宋体">#include &lt;iostream&gt;<br/>
#include &lt;string&gt;</FONT></P>
<p><font FACE="宋体">using namespace std;</FONT></P>
<p><font FACE="宋体">int main()<br/>
{<br/>
&nbsp;char Source[300],Str[300];<br/>
&nbsp;int i,j,LenSource,LenStr,Pos[300];<br/>
&nbsp;bool Find;</FONT></P>
<p><font FACE="宋体">&nbsp;gets(Source);<br/>
&nbsp;gets(Str);<br/>
&nbsp;LenStr=int(strlen(Str));<br/>
&nbsp;LenSource=int(strlen(Source));<br/>
&nbsp;Pos[0]=-1;<br/>
&nbsp;for (i=0;i&lt;=LenStr-1;i++)<br/>
&nbsp;{<br/>
&nbsp;&nbsp;Find=false;<br/>
&nbsp;&nbsp;for
(j=Pos[i]+1;j&lt;=LenSource-1;j++)<br/>
&nbsp;&nbsp;&nbsp;if
(Source[j]==Str[i])<br/>
&nbsp;&nbsp;&nbsp;{<br/>
&nbsp;&nbsp;&nbsp;&nbsp;Pos[i+1]=j;<br/>

&nbsp;&nbsp;&nbsp;&nbsp;Find=true;<br/>

&nbsp;&nbsp;&nbsp;&nbsp;break;<br/>

&nbsp;&nbsp;&nbsp;}<br/>
&nbsp;&nbsp;&nbsp;if (!Find)
break;<br/>
&nbsp;}<br/>
&nbsp;if (Find)<br/>
&nbsp;{<br/>
&nbsp;&nbsp;cout&lt;&lt;"Yes\n";<br/>
&nbsp;&nbsp;for (i=1;i&lt;=LenStr;i++)
cout&lt;&lt;Pos[i]+1&lt;&lt;' ';<br/>
&nbsp;&nbsp;cout&lt;&lt;'\n';<br/>
&nbsp;}<br/>
&nbsp;else cout&lt;&lt;"No"&lt;&lt;endl;<br/>
&nbsp;return 0;<br/>
}</FONT></P>
</DIV>
]]></description>
            <author>游侠UFO</author>
            <category>程序设计习题集</category>
            <comments>http://blog.sina.com.cn/s/blog_4033131f010089yz.html#comment</comments>
            <pubDate>Tue, 18 Dec 2007 14:34:19 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4033131f010089yz.html</guid>
        </item>
        <item>
            <title>今天幸运啊，车只是差点被偷</title>
            <link>http://blog.sina.com.cn/s/blog_4033131f010089n7.html</link>
            <description><![CDATA[<div>&nbsp;&nbsp;&nbsp;
今天下午体育测试，地点在（西南科技大学）新区东七A座一楼。鉴于路途遥远，自然我是骑车过去的。到那里看人还挺多，于是就把车放在了门口就进去测试了。</DIV>
<div>
&nbsp;&nbsp;&nbsp;&nbsp;等测试结束出来，发现车已经不见了，当时第一个反应就是遇贼了。看停车的地方，地上没有坏锁，按照从网上得来的经验，偷车贼一般会把撬开的锁丢在原地，然后骑走车，所以当时直觉告诉我大概锁没撬开，车可能还在附近。当时跟着直觉往东六方向走，居然在下面一个花坛的后面（比较隐蔽的地方，估计是贼人准备回去拿高级工具来开锁）找到了我的车（我极其惊讶于我那准确的直觉）。锁有被撬的痕迹，不过没被打开。但是郁闷的是我自己也打不开了，最后不得不打电话叫了两个人（感激啊！)帮忙一起抬着车长途跋涉去修车的地方开锁。最后锁打开了，车上也掉了一块漆（有种想把偷车贼揪出来揍一顿的冲动）。</DIV>
<div>&nbsp;&nbsp;&nbsp;
看来网上车友们说得对啊，最好的锁是“眼锁”（即在没有人看管的情况下，不要让爱车离开自己的视线）。</DIV>
]]></description>
            <author>游侠UFO</author>
            <category>其它</category>
            <comments>http://blog.sina.com.cn/s/blog_4033131f010089n7.html#comment</comments>
            <pubDate>Mon, 17 Dec 2007 13:22:59 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4033131f010089n7.html</guid>
        </item>
        <item>
            <title>宴会</title>
            <link>http://blog.sina.com.cn/s/blog_4033131f010089il.html</link>
            <description><![CDATA[<div>
<p ALIGN="center"><font COLOR="blue" SIZE="5">宴会</FONT></P>
<p ALIGN="center">Time Limit:1000MS&nbsp; Memory
Limit:65536K<br/>
Total Submit:76 Accepted:24</P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Description</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">在一个宴会中一共有n位来宾，依照来宾的到达时间和离开时间登记。知道第i位来宾在Xi时刻到达，在Yi时刻离开。因此第i位来宾在宴会场的时间为[Xi，Yi)，编写一程序。读入Xi，Yi，1&lt;=
i&lt;= n;找出同一时刻之内最多会有多少人同时在宴会场中。</FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Input</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">第一行为一个正整数n。表示来宾总数。<br/>
接下来n行。每行两个整数Xi，Yi,(Xi &lt;
Yi)。表示第i位来宾到达和离开的时间。</FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Output</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">在某一时刻宴会场的人数会达到最多。输出此时宴会场中的人数。<br/>
</FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Sample
Input</FONT></B></P>
<pre>
<font FACE="Times New Roman" SIZE="3">3
1 3
3 4
2 3</FONT>
</PRE>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Sample
Output</FONT></B></P>
<pre>
<font FACE="Times New Roman" SIZE="3">2</FONT>
</PRE>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Source</FONT></B></P>
<p ALIGN="left">&nbsp;</P>
<p><font FACE="宋体">#include &lt;iostream&gt;</FONT></P>
<p><font FACE="宋体">using namespace std;</FONT></P>
<p><font FACE="宋体">int main()<br/>
{<br/>
&nbsp;int
n,Begin[1000],End[1000],i,j,MaxCount=0,Count;</FONT></P>
<p><font FACE="宋体">&nbsp;cin&gt;&gt;n;<br/>
&nbsp;for (i=0;i&lt;=n-1;i++)
cin&gt;&gt;Begin[i]&gt;&gt;End[i];<br/>
&nbsp;for (i=0;i&lt;=n-1;i++)<br/>
&nbsp;{<br/>
&nbsp;&nbsp;Count=0;<br/>
&nbsp;&nbsp;for (j=0;j&lt;=n-1;j++)<br/>
&nbsp;&nbsp;&nbsp;if
(Begin[j]&lt;=Begin[i] &amp;&amp; Begin[i]&lt;End[j])
Count++;<br/>
&nbsp;&nbsp;if (Count&gt;MaxCount)
MaxCount=Count;<br/>
&nbsp;}<br/>
&nbsp;cout&lt;&lt;MaxCount&lt;&lt;endl;<br/>
&nbsp;return 0;<br/>
}</FONT></P>
</DIV>
]]></description>
            <author>游侠UFO</author>
            <category>程序设计习题集</category>
            <comments>http://blog.sina.com.cn/s/blog_4033131f010089il.html#comment</comments>
            <pubDate>Mon, 17 Dec 2007 06:46:14 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4033131f010089il.html</guid>
        </item>
        <item>
            <title>Sum</title>
            <link>http://blog.sina.com.cn/s/blog_4033131f01008911.html</link>
            <description><![CDATA[<div>
<p ALIGN="center"><font COLOR="blue" SIZE="5">Sum</FONT></P>
<p ALIGN="center">Time Limit:1000MS&nbsp; Memory
Limit:65536K<br/>
Total Submit:33 Accepted:19</P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Description</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3"><br/>
Your task is to find the sum of all integer numbers lying between 1
and N inclusive.</FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Input</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3"><br/>
An integer number that is not greater than 10000</FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Output</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3"><br/>
The sum according to the rule above.</FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Sample
Input</FONT></B></P>
<pre>
<font FACE="Times New Roman" SIZE="3">-3</FONT>
</PRE>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Sample
Output</FONT></B></P>
<pre>
<font FACE="Times New Roman" SIZE="3">-5</FONT>
</PRE>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Source</FONT></B></P>
<p ALIGN="left">&nbsp;</P>
<p><font FACE="宋体">#include &lt;iostream&gt;</FONT></P>
<p><font FACE="宋体">using namespace std;</FONT></P>
<p><font FACE="宋体">int main()<br/>
{<br/>
&nbsp;int n;</FONT></P>
<p><font FACE="宋体">&nbsp;cin&gt;&gt;n;<br/>
&nbsp;if (n&gt;0)
cout&lt;&lt;(1+n)*n/2&lt;&lt;endl;<br/>
&nbsp;else
cout&lt;&lt;(-1+n)*(-n)/2+1&lt;&lt;endl;<br/>
&nbsp;return 0;<br/>
}</FONT></P>
</DIV>
]]></description>
            <author>游侠UFO</author>
            <category>程序设计习题集</category>
            <comments>http://blog.sina.com.cn/s/blog_4033131f01008911.html#comment</comments>
            <pubDate>Sat, 15 Dec 2007 15:01:31 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4033131f01008911.html</guid>
        </item>
        <item>
            <title>做一名聪明的CS玩家</title>
            <link>http://blog.sina.com.cn/s/blog_4033131f010088td.html</link>
            <description><![CDATA[<div>
<p ALIGN="center"><font COLOR="blue" SIZE="5">做一名聪明的CS玩家</FONT></P>
<p ALIGN="center">Time Limit:1000MS&nbsp; Memory
Limit:65536K<br/>
Total Submit:17 Accepted:8</P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Description</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">作为计算机学院的学生，CS应该是大家都很熟悉的一款游戏。那么如果你是一个真正的CS玩家，不如来试下这道题目吧。<br/>

当你在CSing的时候，什么事情最让你郁闷呢，估计就是当你与敌人刚要开战的时候，发现自己没有子弹了吧^_^。这个时候最聪明的选择就是赶快回到老家去买子弹继续战斗。那么怎样回到老家需要的时间最短呢？？<br/>
</FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Input</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">输入的第一行有两个整数N,M分别表示的是地图的宽和长(1 =&lt; M
=&lt; N &lt;=
100)，接下来的N行分别输入CS地图的具体情况。‘@’表示的是你现在所在的位置,‘#’表示的你老家的位置，‘X’表示的是敌人可能出现的位置，虽然是可能出现的位置，但是没有子弹的你显然不愿意冒险走这个位置，即使要节省时间。
‘*’表示的是你可以放心走过的安全位置。</FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Output</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">求出在保证安全的条件下从‘@’到老家‘#’所需要的最小时间并且输出，假设每走一步需要一个单位的时间，且你只能向上下左右四个方向走，并且不能走出CS地图的范围。如果通过安全的位置点无法到达老家，则输出“GAME
OVER”</FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Sample
Input</FONT></B></P>
<pre>
<font FACE="Times New Roman" SIZE="3">5 5
***XX
*@XXX
**XX#
***X*
*****
</FONT>
</PRE>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Sample
Output</FONT></B></P>
<pre>
<font FACE="Times New Roman" SIZE="3">8</FONT>
</PRE>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Hint</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">Archmager：看来henry是很爱玩cs了，这道题看似比较难，不过大家还是有能力解决的，提示一下，Archmager在解决时用到了类似处理迷宫问题的回朔法。</FONT></P>
<p><font FACE="Times New Roman" SIZE="3">PS：我（游侠UFO）是用宽搜做的，所以代码很长，呵呵。</FONT></P>
<p>&nbsp;</P>
<p><b><font COLOR="#333399" SIZE="5">Source</FONT></B></P>
<p ALIGN="left">&nbsp;</P>
<p><font FACE="宋体">#include &lt;iostream&gt;</FONT></P>
<p><font FACE="宋体">using namespace std;</FONT></P>
<p><font FACE="宋体">struct CoordinateType<br/>
{<br/>
&nbsp;int X,Y;<br/>
} ;</FONT></P>
<p><font FACE="宋体">struct QueueNode<br/>
{<br/>
&nbsp;CoordinateType Data;<br/>
&nbsp;struct QueueNode *Next;<br/>
} ;</FONT></P>
<p><font FACE="宋体">struct QueueType<br/>
{<br/>
&nbsp;struct QueueNode *Front,*Rear;<br/>
} ;</FONT></P>
<p><font FACE="宋体">int InitQueue(struct QueueType *Queue)<br/>
{<br/>
&nbsp;Queue-&gt;Front=(struct QueueNode
*)malloc(sizeof(struct QueueNode));<br/>
&nbsp;Queue-&gt;Rear=Queue-&gt;Front;<br/>
&nbsp;if (Queue-&gt;Front==NULL) return 1;<br/>
&nbsp;else<br/>
&nbsp;{<br/>
&nbsp;&nbsp;Queue-&gt;Front-&gt;Next=NULL;<br/>

&nbsp;&nbsp;return 0;<br/>
&nbsp;}<br/>
}</FONT></P>
<p><font FACE="宋体">void DestroyQueue(struct QueueType
*Queue)<br/>
{<br/>
&nbsp;while (Queue-&gt;Front!=NULL)<br/>
&nbsp;{<br/>
&nbsp;&nbsp;Queue-&gt;Rear=Queue-&gt;Front-&gt;Next;<br/>

&nbsp;&nbsp;free(Queue-&gt;Front);<br/>
&nbsp;&nbsp;Queue-&gt;Front=Queue-&gt;Rear;<br/>

&nbsp;}<br/>
}</FONT></P>
<p><font FACE="宋体">int EnQueue(struct QueueType *Queue,
CoordinateType x)<br/>
{<br/>
&nbsp;struct QueueNode *Temp;</FONT></P>
<p><font FACE="宋体">&nbsp;Temp=(struct QueueNode
*)malloc(sizeof(struct QueueNode));<br/>
&nbsp;if (Temp==NULL) return 1;<br/>
&nbsp;else<br/>
&nbsp;{<br/>
&nbsp;&nbsp;Temp-&gt;Data=x;<br/>
&nbsp;&nbsp;Temp-&gt;Next=NULL;<br/>
&nbsp;&nbsp;Queue-&gt;Rear-&gt;Next=Temp;<br/>

&nbsp;&nbsp;Queue-&gt;Rear=Temp;<br/>
&nbsp;&nbsp;return 0;<br/>
&nbsp;}<br/>
}</FONT></P>
<p><font FACE="宋体">int DeQueue(struct QueueType *Queue,
CoordinateType *x)<br/>
{<br/>
&nbsp;struct QueueNode *Temp;</FONT></P>
<p><font FACE="宋体">&nbsp;if
(Queue-&gt;Front==Queue-&gt;Rear) return 1;<br/>
&nbsp;else<br/>
&nbsp;{<br/>
&nbsp;&nbsp;Temp=Queue-&gt;Front-&gt;Next;<br/>

&nbsp;&nbsp;*x=Temp-&gt;Data;<br/>
&nbsp;&nbsp;Queue-&gt;Front-&gt;Next=Temp-&gt;Next;<br/>

&nbsp;&nbsp;if (Queue-&gt;Rear==Temp)
Queue-&gt;Rear=Queue-&gt;Front;<br/>
&nbsp;&nbsp;free(Temp);<br/>
&nbsp;&nbsp;return 0;<br/>
&nbsp;}<br/>
}</FONT></P>
<p><font FACE="宋体">int BFS(int Map[][102], int Width, int Height,
CoordinateType Start)<br/>
{<br/>
&nbsp;struct QueueType Queue;<br/>
&nbsp;CoordinateType Temp;<br/>
&nbsp;int i,j,Visited[102][102];</FONT></P>
<p><font FACE="宋体">&nbsp;for
(i=0;i&lt;=Height+1;i++)<br/>
&nbsp;&nbsp;for (j=0;j&lt;=Width+1;j++)
Visited[i][j]=0;<br/>
&nbsp;InitQueue(&amp;Queue);<br/>
&nbsp;EnQueue(&amp;Queue,Start);<br/>
&nbsp;Visited[Start.X][Start.Y]=1;<br/>
&nbsp;while (Queue.Front!=Queue.Rear)<br/>
&nbsp;{<br/>
&nbsp;&nbsp;DeQueue(&amp;Queue,&amp;Temp);<br/>

&nbsp;&nbsp;if
(Map[Temp.X][Temp.Y]==2)<br/>
&nbsp;&nbsp;{<br/>
&nbsp;&nbsp;&nbsp;DestroyQueue(&amp;Queue);<br/>

&nbsp;&nbsp;&nbsp;return
Visited[Temp.X][Temp.Y];<br/>
&nbsp;&nbsp;}<br/>
&nbsp;&nbsp;if (Map[Temp.X+1][Temp.Y]!=1
&amp;&amp; Visited[Temp.X+1][Temp.Y]==0)<br/>
&nbsp;&nbsp;{<br/>
&nbsp;&nbsp;&nbsp;Visited[Temp.X+1][Temp.Y]=Visited[Temp.X][Temp.Y]+1;<br/>

&nbsp;&nbsp;&nbsp;Temp.X++;<br/>

&nbsp;&nbsp;&nbsp;EnQueue(&amp;Queue,Temp);<br/>

&nbsp;&nbsp;&nbsp;Temp.X--;<br/>

&nbsp;&nbsp;}<br/>
&nbsp;&nbsp;if (Map[Temp.X-1][Temp.Y]!=1
&amp;&amp; Visited[Temp.X-1][Temp.Y]==0)<br/>
&nbsp;&nbsp;{<br/>
&nbsp;&nbsp;&nbsp;Visited[Temp.X-1][Temp.Y]=Visited[Temp.X][Temp.Y]+1;<br/>

&nbsp;&nbsp;&nbsp;Temp.X--;<br/>

&nbsp;&nbsp;&nbsp;EnQueue(&amp;Queue,Temp);<br/>

&nbsp;&nbsp;&nbsp;Temp.X++;<br/>

&nbsp;&nbsp;}<br/>
&nbsp;&nbsp;if (Map[Temp.X][Temp.Y+1]!=1
&amp;&amp; Visited[Temp.X][Temp.Y+1]==0)<br/>
&nbsp;&nbsp;{<br/>
&nbsp;&nbsp;&nbsp;Visited[Temp.X][Temp.Y+1]=Visited[Temp.X][Temp.Y]+1;<br/>

&nbsp;&nbsp;&nbsp;Temp.Y++;<br/>

&nbsp;&nbsp;&nbsp;EnQueue(&amp;Queue,Temp);<br/>

&nbsp;&nbsp;&nbsp;Temp.Y--;<br/>

&nbsp;&nbsp;}<br/>
&nbsp;&nbsp;if (Map[Temp.X][Temp.Y-1]!=1
&amp;&amp; Visited[Temp.X][Temp.Y-1]==0)<br/>
&nbsp;&nbsp;{<br/>
&nbsp;&nbsp;&nbsp;Visited[Temp.X][Temp.Y-1]=Visited[Temp.X][Temp.Y]+1;<br/>

&nbsp;&nbsp;&nbsp;Temp.Y--;<br/>

&nbsp;&nbsp;&nbsp;EnQueue(&amp;Queue,Temp);<br/>

&nbsp;&nbsp;&nbsp;Temp.Y++;<br/>

&nbsp;&nbsp;}<br/>
&nbsp;}<br/>
&nbsp;DestroyQueue(&amp;Queue);<br/>
&nbsp;return 0;<br/>
}</FONT></P>
<p><font FACE="宋体"><br/>
int main()<br/>
{<br/>
&nbsp;char Temp;<br/>
&nbsp;CoordinateType Start;<br/>
&nbsp;int Map[102][102],i,j,Width,Height,Ans;<br/>
&nbsp;<br/>
&nbsp;cin&gt;&gt;Height&gt;&gt;Width;<br/>
&nbsp;for (i=0;i&lt;=Width+1;i++)<br/>
&nbsp;{<br/>
&nbsp;&nbsp;Map[0][i]=1;<br/>
&nbsp;&nbsp;Map[Height+1][i]=1;<br/>
&nbsp;}<br/>
&nbsp;for (i=0;i&lt;=Height+1;i++)<br/>
&nbsp;{<br/>
&nbsp;&nbsp;Map[i][0]=1;<br/>
&nbsp;&nbsp;Map[i][Width+1]=1;<br/>
&nbsp;}<br/>
&nbsp;for (i=1;i&lt;=Height;i++)<br/>
&nbsp;&nbsp;for (j=1;j&lt;=Width;j++)<br/>
&nbsp;&nbsp;{<br/>
&nbsp;&nbsp;&nbsp;cin&gt;&gt;Temp;<br/>

&nbsp;&nbsp;&nbsp;switch
(Temp)<br/>
&nbsp;&nbsp;&nbsp;{<br/>
&nbsp;&nbsp;&nbsp;case
'*':<br/>
&nbsp;&nbsp;&nbsp;&nbsp;Map[i][j]=0;<br/>

&nbsp;&nbsp;&nbsp;&nbsp;break;<br/>

&nbsp;&nbsp;&nbsp;case
'X':<br/>
&nbsp;&nbsp;&nbsp;&nbsp;Map[i][j]=1;<br/>

&nbsp;&nbsp;&nbsp;&nbsp;break;<br/>

&nbsp;&nbsp;&nbsp;case
'@':<br/>
&nbsp;&nbsp;&nbsp;&nbsp;Start.X=i;<br/>

&nbsp;&nbsp;&nbsp;&nbsp;Start.Y=j;<br/>

&nbsp;&nbsp;&nbsp;&nbsp;Map[i][j]=0;<br/>

&nbsp;&nbsp;&nbsp;&nbsp;break;<br/>

&nbsp;&nbsp;&nbsp;case
'#':<br/>
&nbsp;&nbsp;&nbsp;&nbsp;Map[i][j]=2;<br/>

&nbsp;&nbsp;&nbsp;}<br/>
&nbsp;&nbsp;}<br/>
&nbsp;Ans=BFS(Map,Width,Height,Start);<br/>
&nbsp;if (Ans&gt;0)
cout&lt;&lt;Ans-1&lt;&lt;endl;<br/>
&nbsp;else cout&lt;&lt;"GAME OVER"&lt;&lt;endl;<br/>
&nbsp;return 0;<br/>
}</FONT></P>
</DIV>
]]></description>
            <author>游侠UFO</author>
            <category>程序设计习题集</category>
            <comments>http://blog.sina.com.cn/s/blog_4033131f010088td.html#comment</comments>
            <pubDate>Sat, 15 Dec 2007 05:04:52 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4033131f010088td.html</guid>
        </item>
        <item>
            <title>字符大小写转化问题</title>
            <link>http://blog.sina.com.cn/s/blog_4033131f010088do.html</link>
            <description><![CDATA[<div>
<p ALIGN="center"><font COLOR="blue" SIZE="5">字符大小写转化问题</FONT></P>
<p ALIGN="center">Time Limit:1000MS&nbsp; Memory
Limit:65536K<br/>
Total Submit:17 Accepted:13</P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Description</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">字符串处理问题是程序设计中要求细心的一个环节，细心和良好的RP是你AC这道题目的关键^_^！<br/>

题目的意思很简单，对于我的每个输入的字符串（长度小于20个字符），对于其中的每一个字符，如果它是大写的英文字母，把它转化为小写输出，如果它是小写的字母，转化为大写，如果不是字母，则用’@’代替并输出即可。<br/>

<br/>
<br/></FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Input</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3"><br/>
输入的第一行为要测试的字符串的数目N，接下来的2到N+1行输入的是字符串，对于每个输入。</FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Output</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3"><br/>
按照上述规则输出相应的内容,每个输出占一行。那样，你就会看到ACCEPT的字符串了^_^!</FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Sample
Input</FONT></B></P>
<pre>
<font FACE="Times New Roman" SIZE="3">3
cDS
DDD
&amp;aS</FONT>
</PRE>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Sample
Output</FONT></B></P>
<pre>
<font FACE="Times New Roman" SIZE="3">Cds
ddd
@As</FONT>
</PRE>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Source</FONT></B></P>
<p ALIGN="left">&nbsp;</P>
<p><font FACE="宋体">#include &lt;iostream&gt;<br/>
#include &lt;string&gt;</FONT></P>
<p><font FACE="宋体">using namespace std;</FONT></P>
<p><font FACE="宋体">int main()<br/>
{<br/>
&nbsp;char Str[256];<br/>
&nbsp;int n,i,j,Len;</FONT></P>
<p><font FACE="宋体">&nbsp;cin&gt;&gt;n;<br/>
&nbsp;getchar();<br/>
&nbsp;for (i=1;i&lt;=n;i++)<br/>
&nbsp;{<br/>
&nbsp;&nbsp;gets(Str);<br/>
&nbsp;&nbsp;Len=(int)strlen(Str);<br/>
&nbsp;&nbsp;for (j=0;j&lt;=Len-1;j++)<br/>
&nbsp;&nbsp;&nbsp;if
(65&lt;=Str[j] &amp;&amp; Str[j]&lt;=90)
printf("%c",Str[j]+32);<br/>
&nbsp;&nbsp;&nbsp;else<br/>
&nbsp;&nbsp;&nbsp;&nbsp;if
(97&lt;=Str[j] &amp;&amp; Str[j]&lt;=122)
printf("%c",Str[j]-32);<br/>
&nbsp;&nbsp;&nbsp;&nbsp;else
cout&lt;&lt;'@';<br/>
&nbsp;&nbsp;cout&lt;&lt;'\n';<br/>
&nbsp;}<br/>
&nbsp;return 0;<br/>
}</FONT></P>
</DIV>
]]></description>
            <author>游侠UFO</author>
            <category>程序设计习题集</category>
            <comments>http://blog.sina.com.cn/s/blog_4033131f010088do.html#comment</comments>
            <pubDate>Thu, 13 Dec 2007 14:21:05 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4033131f010088do.html</guid>
        </item>
        <item>
            <title>多级排序问题</title>
            <link>http://blog.sina.com.cn/s/blog_4033131f010088dg.html</link>
            <description><![CDATA[<div>
<p ALIGN="center"><font COLOR="blue" SIZE="5">多级排序问题</FONT></P>
<p ALIGN="center">Time Limit:1000MS&nbsp; Memory
Limit:65536K<br/>
Total Submit:23 Accepted:14</P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Description</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">经过了一个前一段时间对数据结构中排序一章的学习，相信大家对排序也有了较深的感情。<br/>

当然，这就是一个简单的排序问题，try to do it
^_^！在众多的排序算法中，你会如何选择呢？<br/>
假设现在需要你实现一个小学生成绩管理系统，要求把成绩好的同学放到前面的。我们首先是按个人的总成绩进行排名，如果某两个人的总分相同，则按他们的语文成绩进行排名，如果总成绩和语文成绩都相同时，对于这两个人，我们是按照他们的数学成绩进行排名的，他们每个人都有三门课程，语文，数学和英语！<br/>
</FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Input</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">现在首先输入一行为总共输入学生的数目N，然后在2到N+1行中分别输入学生姓名和对应学生的总分，语文和数学成绩（每个数据之间有一个空格）</FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Output</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">输出最后排序顺序的名字序列。每个名字占一行。我们保证不会存在两个人总成绩和各门的成绩均分别相同的情况。</FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Sample
Input</FONT></B></P>
<pre>
<font FACE="Times New Roman" SIZE="3">3
Henry 225 100 98
Marry 210 95 100
Jhon 210 98 85
</FONT>
</PRE>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Sample
Output</FONT></B></P>
<pre>
<font FACE="Times New Roman" SIZE="3">Henry 
Jhon 
Marry
</FONT>
</PRE>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Source</FONT></B></P>
<p ALIGN="left">&nbsp;</P>
<p><font FACE="宋体">#include &lt;iostream&gt;<br/>
#include &lt;string&gt;</FONT></P>
<p><font FACE="宋体">using namespace std;</FONT></P>
<p><font FACE="宋体">class StudentClass<br/>
{<br/>
private:<br/>
&nbsp;string Name;<br/>
&nbsp;int Total,Chinese,Math;</FONT></P>
<p><font FACE="宋体">public:<br/>
&nbsp;void Input()<br/>
&nbsp;{<br/>
&nbsp;&nbsp;cin&gt;&gt;Name&gt;&gt;Total&gt;&gt;Chinese&gt;&gt;Math;<br/>

&nbsp;}</FONT></P>
<p><font FACE="宋体">&nbsp;void Output()<br/>
&nbsp;{<br/>
&nbsp;&nbsp;cout&lt;&lt;Name&lt;&lt;'\n';<br/>

&nbsp;}</FONT></P>
<p><font FACE="宋体">&nbsp;friend void
SortName(StudentClass Student[], int Count);<br/>
&nbsp;friend void SortMath(StudentClass Student[], int
Count);<br/>
&nbsp;friend void SortChinese(StudentClass Student[],
int Count);<br/>
&nbsp;friend void SortTotal(StudentClass Student[], int
Count);<br/>
} ;</FONT></P>
<p><font FACE="宋体">void SortName(StudentClass Student[], int
Count)<br/>
{<br/>
&nbsp;int i,j;<br/>
&nbsp;StudentClass k;</FONT></P>
<p><font FACE="宋体">&nbsp;for
(i=0;i&lt;=Count-2;i++)<br/>
&nbsp;&nbsp;for
(j=Count-1;j&gt;=i+1;j--)<br/>
&nbsp;&nbsp;&nbsp;if
(Student[j-1].Name&gt;Student[j].Name)<br/>
&nbsp;&nbsp;&nbsp;{<br/>
&nbsp;&nbsp;&nbsp;&nbsp;k=Student[j-1];<br/>

&nbsp;&nbsp;&nbsp;&nbsp;Student[j-1]=Student[j];<br/>

&nbsp;&nbsp;&nbsp;&nbsp;Student[j]=k;<br/>

&nbsp;&nbsp;&nbsp;}<br/>
}</FONT></P>
<p><font FACE="宋体">void SortMath(StudentClass Student[], int
Count)<br/>
{<br/>
&nbsp;int i,j;<br/>
&nbsp;StudentClass k;</FONT></P>
<p><font FACE="宋体">&nbsp;for
(i=0;i&lt;=Count-2;i++)<br/>
&nbsp;&nbsp;for
(j=Count-1;j&gt;=i+1;j--)<br/>
&nbsp;&nbsp;&nbsp;if
(Student[j-1].Math&lt;Student[j].Math)<br/>
&nbsp;&nbsp;&nbsp;{<br/>
&nbsp;&nbsp;&nbsp;&nbsp;k=Student[j-1];<br/>

&nbsp;&nbsp;&nbsp;&nbsp;Student[j-1]=Student[j];<br/>

&nbsp;&nbsp;&nbsp;&nbsp;Student[j]=k;<br/>

&nbsp;&nbsp;&nbsp;}<br/>
}</FONT></P>
<p><font FACE="宋体">void SortChinese(StudentClass Student[], int
Count)<br/>
{<br/>
&nbsp;int i,j;<br/>
&nbsp;StudentClass k;</FONT></P>
<p><font FACE="宋体">&nbsp;for
(i=0;i&lt;=Count-2;i++)<br/>
&nbsp;&nbsp;for
(j=Count-1;j&gt;=i+1;j--)<br/>
&nbsp;&nbsp;&nbsp;if
(Student[j-1].Chinese&lt;Student[j].Chinese)<br/>
&nbsp;&nbsp;&nbsp;{<br/>
&nbsp;&nbsp;&nbsp;&nbsp;k=Student[j-1];<br/>

&nbsp;&nbsp;&nbsp;&nbsp;Student[j-1]=Student[j];<br/>

&nbsp;&nbsp;&nbsp;&nbsp;Student[j]=k;<br/>

&nbsp;&nbsp;&nbsp;}<br/>
}</FONT></P>
<p><font FACE="宋体">void SortTotal(StudentClass Student[], int
Count)<br/>
{<br/>
&nbsp;int i,j;<br/>
&nbsp;StudentClass k;</FONT></P>
<p><font FACE="宋体">&nbsp;for
(i=0;i&lt;=Count-2;i++)<br/>
&nbsp;&nbsp;for
(j=Count-1;j&gt;=i+1;j--)<br/>
&nbsp;&nbsp;&nbsp;if
(Student[j-1].Total&lt;Student[j].Total)<br/>
&nbsp;&nbsp;&nbsp;{<br/>
&nbsp;&nbsp;&nbsp;&nbsp;k=Student[j-1];<br/>

&nbsp;&nbsp;&nbsp;&nbsp;Student[j-1]=Student[j];<br/>

&nbsp;&nbsp;&nbsp;&nbsp;Student[j]=k;<br/>

&nbsp;&nbsp;&nbsp;}<br/>
}</FONT></P>
<p><font FACE="宋体">int main()<br/>
{<br/>
&nbsp;StudentClass Student[256];<br/>
&nbsp;int i,Count;<br/>
&nbsp;<br/>
&nbsp;cin&gt;&gt;Count;<br/>
&nbsp;for (i=0;i&lt;=Count-1;i++)
Student[i].Input();<br/>
&nbsp;SortName(Student,Count);<br/>
&nbsp;SortMath(Student,Count);<br/>
&nbsp;SortChinese(Student,Count);<br/>
&nbsp;SortTotal(Student,Count);<br/>
&nbsp;for (i=0;i&lt;=Count-1;i++)
Student[i].Output();<br/>
&nbsp;return 0;<br/>
}</FONT></P>
</DIV>
]]></description>
            <author>游侠UFO</author>
            <category>程序设计习题集</category>
            <comments>http://blog.sina.com.cn/s/blog_4033131f010088dg.html#comment</comments>
            <pubDate>Thu, 13 Dec 2007 14:08:23 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4033131f010088dg.html</guid>
        </item>
        <item>
            <title>拉丁方阵</title>
            <link>http://blog.sina.com.cn/s/blog_4033131f010088d0.html</link>
            <description><![CDATA[<div>
<p ALIGN="center"><font COLOR="blue" SIZE="5">拉丁方阵</FONT></P>
<p ALIGN="center">Time Limit:1000MS&nbsp; Memory
Limit:65536K<br/>
Total Submit:24 Accepted:18</P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Description</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">还是Archmager的题了，这次就没有那么多废话了，请大家构造 N*N
阶的拉丁方阵(2&lt;=N&lt;=9)，使方阵中的每一行和每一列中数字1到N只出现一次。如N=4时：<br/>

1 2 3 4<br/>
2 3 4 1<br/>
3 4 1 2<br/>
4 1 2 3<br/>
这可是送分的题哦，抓紧把！！！<br/></FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Input</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">输入n;</FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Output</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">输出对应的拉丁矩阵，每两个数字之间间隔一个空格，每输出n个数后换行。</FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Sample
Input</FONT></B></P>
<pre>
<font FACE="Times New Roman" SIZE="3">4</FONT>
</PRE>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Sample
Output</FONT></B></P>
<pre>
<font FACE="Times New Roman" SIZE="3">1 2 3 4
2 3 4 1
3 4 1 2
4 1 2 3 
</FONT>
</PRE>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Source</FONT></B></P>
<p ALIGN="left">&nbsp;</P>
<p><font FACE="宋体">#include &lt;iostream&gt;</FONT></P>
<p><font FACE="宋体">using namespace std;</FONT></P>
<p><font FACE="宋体">int main()<br/>
{<br/>
&nbsp;int n,i,j,Temp;</FONT></P>
<p><font FACE="宋体">&nbsp;cin&gt;&gt;n;<br/>
&nbsp;for (i=1;i&lt;=n;i++)<br/>
&nbsp;{<br/>
&nbsp;&nbsp;Temp=i;<br/>
&nbsp;&nbsp;for (j=1;j&lt;=n;j++)<br/>
&nbsp;&nbsp;{<br/>
&nbsp;&nbsp;&nbsp;cout&lt;&lt;Temp&lt;&lt;'
';<br/>
&nbsp;&nbsp;&nbsp;Temp++;<br/>
&nbsp;&nbsp;&nbsp;if
(Temp&gt;n) Temp=Temp-n;<br/>
&nbsp;&nbsp;}<br/>
&nbsp;&nbsp;cout&lt;&lt;'\n';<br/>
&nbsp;}<br/>
&nbsp;return 0;<br/>
}</FONT></P>
</DIV>
]]></description>
            <author>游侠UFO</author>
            <category>程序设计习题集</category>
            <comments>http://blog.sina.com.cn/s/blog_4033131f010088d0.html#comment</comments>
            <pubDate>Thu, 13 Dec 2007 13:33:49 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4033131f010088d0.html</guid>
        </item>
        <item>
            <title>【简单图形】三角形识别</title>
            <link>http://blog.sina.com.cn/s/blog_4033131f010087uz.html</link>
            <description><![CDATA[<div>
<p ALIGN="center"><font COLOR="blue" SIZE="5">【简单图形】三角形识别</FONT></P>
<p ALIGN="center">Time Limit:1000MS&nbsp; Memory
Limit:65536K<br/>
Total Submit:32 Accepted:17</P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Description</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">这是一个很简单的问题,就是给有一个打印好的三角形.但我们需要知道它有多少行和列.<br/>

其中三角形的图形如下:<br/></FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Input</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">只有一组测试数据，如上面图形类似的一个三角形。见sample
input</FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Output</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">输出只有一行，为其行数row(row&gt;=2)和列数col(col&gt;=
2*row)，两个数字间隔一个空格；见sample output</FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Sample
Input</FONT></B></P>
<pre>
<font FACE="Times New Roman" SIZE="3">0000000000000000000000000
0000000000000000000000000
0000000000001000000000000
0000000000011100000000000
0000000000111110000000000
0000000001111111000000000
0000000011111111100000000
0000000111111111110000000
0000001111111111111000000
0000011111111111111100000
0000111111111111111110000
0001111111111111111111000
0000000000000000000000000
0000000000000000000000000

00000000000000000000
00000000000000000000
0000000001000000000
0000000011100000000
0000000111110000000
0000001111111000000
0000011111111100000
0000111111111110000
0001111111111111000
0011111111111111100
00000000000000000000
00000000000000000000

</FONT>
</PRE>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Sample
Output</FONT></B></P>
<pre>
<font FACE="Times New Roman" SIZE="3">10 19
8 15
</FONT>
</PRE>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Source</FONT></B></P>
<p ALIGN="left">&nbsp;</P>
<p><font FACE="宋体">#include &lt;iostream&gt;<br/>
#include &lt;string&gt;</FONT></P>
<p><font FACE="宋体">using namespace std;</FONT></P>
<p><font FACE="宋体">int main()<br/>
{<br/>
&nbsp;string Row;<br/>
&nbsp;int ColCount=0,RowCount=0,Len,Count,i;</FONT></P>
<p><font FACE="宋体">&nbsp;while (cin&gt;&gt;Row)<br/>
&nbsp;{<br/>
&nbsp;&nbsp;Count=0;<br/>
&nbsp;&nbsp;Len=(int)Row.length();<br/>
&nbsp;&nbsp;for (i=0;i&lt;=Len;i++)<br/>
&nbsp;&nbsp;&nbsp;if
(Row[i]=='1') Count++;<br/>
&nbsp;&nbsp;if (Count&gt;0)
RowCount++;<br/>
&nbsp;&nbsp;if (Count&gt;ColCount)
ColCount=Count;<br/>
&nbsp;}<br/>
&nbsp;cout&lt;&lt;RowCount&lt;&lt;'
'&lt;&lt;ColCount;<br/>
&nbsp;return 0;<br/>
}</FONT></P>
</DIV>
]]></description>
            <author>游侠UFO</author>
            <category>程序设计习题集</category>
            <comments>http://blog.sina.com.cn/s/blog_4033131f010087uz.html#comment</comments>
            <pubDate>Wed, 12 Dec 2007 06:56:19 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4033131f010087uz.html</guid>
        </item>
        <item>
            <title>Lowest Bit Lowest Bit</title>
            <link>http://blog.sina.com.cn/s/blog_4033131f010087r9.html</link>
            <description><![CDATA[<div>
<p ALIGN="center"><font COLOR="blue" SIZE="5">【简单2进制】Lowest
Bit Lowest Bit</FONT></P>
<p ALIGN="center">Time Limit:1000MS&nbsp; Memory
Limit:65536K<br/>
Total Submit:43 Accepted:31</P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Description</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">Given an positive integer
A (1 &lt;= A &lt;= 1000), output the lowest bit of A.<br/>
<br/>
For example, given A = 26, we can write A in binary form as 11010,
so the lowest bit of A is 10, so the output should be 2.<br/>
<br/>
Another example goes like this: given A = 88, we can write A in
binary form as 1011000, so the lowest bit of A is 1000, so the
output should be 8.<br/></FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Input</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">Each line of input
contains only an integer A (1 &lt;= A &lt;= 1000). A line
containing "0" indicates the end of input, and this line is not a
part of the input data</FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Output</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">For each A in the input,
output a line containing only its lowest bit</FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Sample
Input</FONT></B></P>
<pre>
<font FACE="Times New Roman" SIZE="3">26
88
0
</FONT>
</PRE>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Sample
Output</FONT></B></P>
<pre>
<font FACE="Times New Roman" SIZE="3">2
8</FONT>
</PRE>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Source</FONT></B></P>
<p ALIGN="left">&nbsp;</P>
<p><font FACE="宋体">#include &lt;iostream&gt;<br/>
#include &lt;string&gt;</FONT></P>
<p><font FACE="宋体">using namespace std;</FONT></P>
<p><font FACE="宋体">template &lt;typename DataType&gt;<br/>
string DecToN(DataType x, int n)<br/>
{<br/>
&nbsp;string Ans;<br/>
&nbsp;int Count,i,j=0,a[64];</FONT></P>
<p><font FACE="宋体">&nbsp;Count=0;<br/>
&nbsp;if (x==0)<br/>
&nbsp;{<br/>
&nbsp;&nbsp;Ans[0]='0';<br/>
&nbsp;&nbsp;Ans[1]='\0';<br/>
&nbsp;}<br/>
&nbsp;else<br/>
&nbsp;{<br/>
&nbsp;&nbsp;while (x&gt;0)<br/>
&nbsp;&nbsp;{<br/>
&nbsp;&nbsp;&nbsp;a[Count++]=x%n;<br/>

&nbsp;&nbsp;&nbsp;x=x/n;<br/>
&nbsp;&nbsp;}<br/>
&nbsp;&nbsp;for
(i=Count-1;i&gt;=0;i--)<br/>
&nbsp;&nbsp;&nbsp;if
(a[i]&lt;10) Ans.append(1,a[i]+'0');<br/>
&nbsp;&nbsp;&nbsp;else
Ans.append(1,a[i]+'A'-10);<br/>
&nbsp;}<br/>
&nbsp;return Ans;<br/>
}</FONT></P>
<p><font FACE="宋体">long NToDec(string x, int n)<br/>
{<br/>
&nbsp;int a[64],y,Count,i,j;<br/>
&nbsp;long Ans;</FONT></P>
<p><font FACE="宋体">&nbsp;Ans=0;<br/>
&nbsp;for (i=0;i&lt;=(int)x.length()-1;i++)<br/>
&nbsp;&nbsp;if ('0'&lt;=x[i] &amp;&amp;
x[i]&lt;='9') a[i]=x[i]-'0';<br/>
&nbsp;&nbsp;else
a[i]=toupper(x[i])-'A'+10;<br/>
&nbsp;Count=0;<br/>
&nbsp;for (i=(int)x.length()-1;i&gt;=0;i--)<br/>
&nbsp;{<br/>
&nbsp;&nbsp;y=1;<br/>
&nbsp;&nbsp;for (j=1;j&lt;=Count;j++)
y=y*n;<br/>
&nbsp;&nbsp;Count++;<br/>
&nbsp;&nbsp;Ans=Ans+y*a[i];<br/>
&nbsp;}<br/>
&nbsp;return Ans;<br/>
}</FONT></P>
<p><font FACE="宋体">int main()<br/>
{<br/>
&nbsp;string Str;<br/>
&nbsp;int Num,i,Pos,Len;</FONT></P>
<p><font FACE="宋体">&nbsp;cin&gt;&gt;Num;<br/>
&nbsp;while (Num&gt;0)<br/>
&nbsp;{<br/>
&nbsp;&nbsp;Str=DecToN(Num,2);<br/>
&nbsp;&nbsp;Len=1;<br/>
&nbsp;&nbsp;Pos=(int)Str.length();<br/>
&nbsp;&nbsp;for
(i=(int)Str.length()-1;i&gt;=0;i--)<br/>
&nbsp;&nbsp;&nbsp;if
(Str[i]=='1')<br/>
&nbsp;&nbsp;&nbsp;{<br/>
&nbsp;&nbsp;&nbsp;&nbsp;Pos=i;<br/>

&nbsp;&nbsp;&nbsp;&nbsp;break;<br/>

&nbsp;&nbsp;&nbsp;}<br/>
&nbsp;&nbsp;&nbsp;else
Len++;<br/>
&nbsp;&nbsp;Str.assign(Str,Pos,Len);<br/>
&nbsp;&nbsp;cout&lt;&lt;NToDec(Str,2)&lt;&lt;'\n';<br/>

&nbsp;&nbsp;cin&gt;&gt;Num;<br/>
&nbsp;}<br/>
&nbsp;return 0;<br/>
}</FONT></P>
</DIV>
]]></description>
            <author>游侠UFO</author>
            <category>程序设计习题集</category>
            <comments>http://blog.sina.com.cn/s/blog_4033131f010087r9.html#comment</comments>
            <pubDate>Wed, 12 Dec 2007 00:44:08 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4033131f010087r9.html</guid>
        </item>
        <item>
            <title>Special array</title>
            <link>http://blog.sina.com.cn/s/blog_4033131f010087by.html</link>
            <description><![CDATA[<div>
<p ALIGN="center"><font COLOR="blue" SIZE="5">【递归】Special
array</FONT></P>
<p ALIGN="center">Time Limit:1000MS&nbsp; Memory
Limit:65536K<br/>
Total Submit:67 Accepted:20</P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Description</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">输入n和m(20&gt;=m&gt;=n&gt;0)求出所有满足以下方程的正整数数列
i1,i2,...,in，使i1+i2+...+in=m，且i1&gt;=i2...&gt;=in。例如：当n=4,
m=8时，将得到如下5 个数列：<br/>
5 1 1 1<br/>
4 2 1 1<br/>
3 3 1 1<br/>
3 2 2 1<br/>
2 2 2 2<br/>
<br/></FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Input</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">输入只有一行，包含每个数列的元素个数n和数列元素的和m。</FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Output</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">按照字典逆序输出所有的数列，每个数列输出一行，每个数列元素用一个空格分开。</FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Sample
Input</FONT></B></P>
<pre>
<font FACE="Times New Roman" SIZE="3">4 8

</FONT>
</PRE>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Sample
Output</FONT></B></P>
<pre>
<font FACE="Times New Roman" SIZE="3">5 1 1 1
4 2 1 1
3 3 1 1
3 2 2 1
2 2 2 2
</FONT>
</PRE>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Source</FONT></B></P>
<p ALIGN="left">&nbsp;</P>
<p><font FACE="宋体">#include &lt;iostream&gt;</FONT></P>
<p><font FACE="宋体">using namespace std;</FONT></P>
<p><font FACE="宋体">void Split(int Array[], int n, int r, int
Len)<br/>
{<br/>
&nbsp;int i;</FONT></P>
<p><font FACE="宋体">&nbsp;if(n==0)<br/>
&nbsp;{<br/>
&nbsp;&nbsp;for(i=0;i&lt;=r-1;i++)&nbsp;printf("%d
",Array[i]);<br/>
&nbsp;&nbsp;printf("\n");<br/>
&nbsp;}<br/>
&nbsp;else<br/>
&nbsp;&nbsp;for(i=n-Len+1;i&gt;=1;i--)<br/>

&nbsp;&nbsp;&nbsp;if(r==0||i&lt;=Array[r-1])<br/>

&nbsp;&nbsp;&nbsp;{<br/>
&nbsp;&nbsp;&nbsp;&nbsp;Array[r]=i;<br/>

&nbsp;&nbsp;&nbsp;&nbsp;if
(Len&gt;0) Split(Array,n-i,r+1,Len-1);<br/>
&nbsp;&nbsp;&nbsp;}<br/>
}</FONT></P>
<p><font FACE="宋体">int main()<br/>
{<br/>
&nbsp;int Len,Num,Array[20]={0};</FONT></P>
<p><font FACE="宋体">&nbsp;scanf("%d%d",&amp;Len,&amp;Num);<br/>
&nbsp;Split(Array,Num,0,Len);<br/>
&nbsp;return 0;<br/>
}</FONT></P>
</DIV>
]]></description>
            <author>游侠UFO</author>
            <category>程序设计习题集</category>
            <comments>http://blog.sina.com.cn/s/blog_4033131f010087by.html#comment</comments>
            <pubDate>Mon, 10 Dec 2007 14:06:28 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4033131f010087by.html</guid>
        </item>
        <item>
            <title>分解因式</title>
            <link>http://blog.sina.com.cn/s/blog_4033131f010086p8.html</link>
            <description><![CDATA[<div>
<p ALIGN="center"><font COLOR="blue" SIZE="5">【简单】分解因式</FONT></P>
<p ALIGN="center">Time Limit:1000MS&nbsp; Memory
Limit:65536K<br/>
Total Submit:54 Accepted:20</P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Description</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">一个自然数N的正因子个数记为F(N)，例如18的所有正因子为1、2、3、6、9、18，所以F(18)=6。现在给出K，求所有满足F(N)=K的N中最小的数。</FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Input</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">从文件读入数据，第一行为K，其中0 &lt; K &lt;= 80。</FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Output</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">输出到文件第一行，如果存在不大于20000的解，则输出这个N，否则输出“NO
SOLUTION”。</FONT></P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Sample
Input</FONT></B></P>
<pre>
<font FACE="Times New Roman" SIZE="3">9</FONT>
</PRE>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Sample
Output</FONT></B></P>
<pre>
<font FACE="Times New Roman" SIZE="3">36</FONT>
</PRE>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Hint</FONT></B></P>
<p><font FACE="Times New Roman" SIZE="3">输入：17<br/>
输出：NO SOLUTION</FONT></P>
<p ALIGN="left">&nbsp;</P>
<p ALIGN="left"><b><font COLOR="#333399" SIZE="5">Source</FONT></B></P>
<p ALIGN="left">&nbsp;</P>
<p><font FACE="宋体">#include &lt;stdio.h&gt;</FONT></P>
<p><font FACE="宋体">main()<br/>
{<br/>
&nbsp;int
k,Ans[81]={-1,0,2,4,6,16,12,64,24,36,48,1024,60,4096,192,144,120,-1,180,-1,240,576,3072,-1,360,1296,12288,900,960,-1,720,-1,840,9216,-1,5184,1260,-1,-1,-1,1680,-1,2880,-1,15360,3600,-1,-1,2520,-1,6480,-1,-1,-1,6300,-1,6720,-1,-1,-1,5040,-1,-1,14400,7560,-1,-1,-1,-1,-1,-1,-1,10080,-1,-1,-1,-1,-1,-1,-1,15120};</FONT></P>
<p><font FACE="宋体">&nbsp;scanf("%d",&amp;k);<br/>
&nbsp;if (Ans[k]&gt;=0) printf("%d",Ans[k]);<br/>
&nbsp;else printf("NO SOLUTION");<br/>
}</FONT></P>
</DIV>
]]></description>
            <author>游侠UFO</author>
            <category>程序设计习题集</category>
            <comments>http://blog.sina.com.cn/s/blog_4033131f010086p8.html#comment</comments>
            <pubDate>Sun, 09 Dec 2007 03:26:01 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4033131f010086p8.html</guid>
        </item>
        <item>
            <title>求最大公约数</title>
            <link>http://blog.sina.com.cn/s/blog_4033131f01000cux.html</link>
            <description><![CDATA[<p ALIGN="center">&nbsp;</P>
<p ALIGN="left">求最大公约数</P>
<p ALIGN="left">&nbsp;</P>
<pre>
#include &lt;stdio.h&gt;

void GCDandLCM(int m, int n, int *GCD, int *LCM)
{
        int Temp,TempM,TempN;
        
        TempM=m;
        TempN=n;
        Temp=TempM%TempN;
        while (Temp!=0)
        {
                TempM=TempN;
                TempN=Temp;
                Temp=TempM%TempN;
        }
        *GCD=TempN;
        *LCM=m*n/(*GCD);
}

main()
{
        int m,n,GCD,LCM;

        scanf("%d %d",&amp;m,&amp;n);
        GCDandLCM(m,n,&amp;GCD,&amp;LCM);
        printf("%d",GCD);
}
</PRE>
]]></description>
            <author>游侠UFO</author>
            <category>程序设计习题集</category>
            <comments>http://blog.sina.com.cn/s/blog_4033131f01000cux.html#comment</comments>
            <pubDate>Fri, 30 Nov 2007 15:09:52 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4033131f01000cux.html</guid>
        </item>
    </channel>
</rss>
