﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-天上人间</title><link>http://www.cppblog.com/tianshanxue/</link><description /><language>zh-cn</language><lastBuildDate>Tue, 14 Apr 2026 20:52:27 GMT</lastBuildDate><pubDate>Tue, 14 Apr 2026 20:52:27 GMT</pubDate><ttl>60</ttl><item><title>字符串指针</title><link>http://www.cppblog.com/tianshanxue/archive/2005/11/19/1196.html</link><dc:creator>天山雪</dc:creator><author>天山雪</author><pubDate>Sat, 19 Nov 2005 12:52:00 GMT</pubDate><guid>http://www.cppblog.com/tianshanxue/archive/2005/11/19/1196.html</guid><wfw:comment>http://www.cppblog.com/tianshanxue/comments/1196.html</wfw:comment><comments>http://www.cppblog.com/tianshanxue/archive/2005/11/19/1196.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cppblog.com/tianshanxue/comments/commentRss/1196.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/tianshanxue/services/trackbacks/1196.html</trackback:ping><description><![CDATA[char* c1="abcdefg";<BR>char&nbsp;&nbsp; c2[]="abcdefg";<BR>c1是一个指向的字符串常量（只读的）的指针，c2则是一个字符数组的地址，所以可以通过*(c2+i)来改变第二个数组得值，却不能改变第一个得值。<img src ="http://www.cppblog.com/tianshanxue/aggbug/1196.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/tianshanxue/" target="_blank">天山雪</a> 2005-11-19 20:52 <a href="http://www.cppblog.com/tianshanxue/archive/2005/11/19/1196.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>题目1:给定一个任意整数m,给定n&lt;=m,求n个整数使之和为m,结果不能重复</title><link>http://www.cppblog.com/tianshanxue/archive/2005/11/13/1109.html</link><dc:creator>天山雪</dc:creator><author>天山雪</author><pubDate>Sat, 12 Nov 2005 16:24:00 GMT</pubDate><guid>http://www.cppblog.com/tianshanxue/archive/2005/11/13/1109.html</guid><wfw:comment>http://www.cppblog.com/tianshanxue/comments/1109.html</wfw:comment><comments>http://www.cppblog.com/tianshanxue/archive/2005/11/13/1109.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/tianshanxue/comments/commentRss/1109.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/tianshanxue/services/trackbacks/1109.html</trackback:ping><description><![CDATA[<FONT size=4><SPAN style="COLOR: rgb(128,128,128)">&nbsp;&nbsp;&nbsp; 对于算法以前也没学过,前几天看了一本书才明白了</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: rgb(128,128,128)">递归</SPAN><SPAN style="COLOR: rgb(128,128,128)">是怎么回事,正好用到了这一个题目上。</SPAN><BR style="COLOR: rgb(128,128,128)"><BR style="COLOR: rgb(128,128,128)"><SPAN style="COLOR: rgb(128,128,128)">&nbsp;&nbsp;&nbsp; 为了防止重复，n</SPAN><SUB style="COLOR: rgb(128,128,128)">i</SUB><SPAN style="COLOR: rgb(128,128,128)">&lt;=n</SPAN><SUB style="COLOR: rgb(128,128,128)">i+1</SUB><SPAN style="COLOR: rgb(128,128,128)">；最简单的例子：若m=3,n=2,只能由1+2来得到3的结果，其中n</SPAN><SUB style="COLOR: rgb(128,128,128)">1</SUB><SPAN style="COLOR: rgb(128,128,128)">=1,n</SPAN><SUB style="COLOR: rgb(128,128,128)">2</SUB><SPAN style="COLOR: rgb(128,128,128)">=2;若再取n</SPAN><SUB style="COLOR: rgb(128,128,128)">1</SUB><SPAN style="COLOR: rgb(128,128,128)">&gt;n</SPAN><SUB style="COLOR: rgb(128,128,128)">2</SUB><SPAN style="COLOR: rgb(128,128,128)">,就重复了。</SPAN><BR style="COLOR: rgb(128,128,128)"><BR style="COLOR: rgb(128,128,128)"><SPAN style="COLOR: rgb(128,128,128)">&nbsp;&nbsp;&nbsp; 可先确定第一个数的值，第一个数n</SPAN><SUB style="COLOR: rgb(128,128,128)">1</SUB><SPAN style="COLOR: rgb(128,128,128)">取值从1到m/n，如果n</SPAN><SUB style="COLOR: rgb(128,128,128)">1</SUB><SPAN style="COLOR: rgb(128,128,128)">取值大于m/n，则后面的值肯定会有小于n</SPAN><SUB style="COLOR: rgb(128,128,128)">1</SUB><SPAN style="COLOR: rgb(128,128,128)">的，依此类推n</SPAN><SUB style="COLOR: rgb(128,128,128)">i</SUB><SPAN style="COLOR: rgb(154,205,50)">。</SPAN><BR><BR>
<DIV style="BORDER-RIGHT: rgb(204,204,204) 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: rgb(204,204,204) 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: rgb(204,204,204) 1px solid; WIDTH: 98%; PADDING-TOP: 4px; BORDER-BOTTOM: rgb(204,204,204) 1px solid; BACKGROUND-COLOR: rgb(238,238,238)"></DIV><BR></FONT>&nbsp;&nbsp; <BR><img src ="http://www.cppblog.com/tianshanxue/aggbug/1109.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/tianshanxue/" target="_blank">天山雪</a> 2005-11-13 00:24 <a href="http://www.cppblog.com/tianshanxue/archive/2005/11/13/1109.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>