<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://www.gentoo-zh.org/extern.php?action=feed&amp;tid=322&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Gentoo中文社区 / C 练习实例13 - 水仙花数]]></title>
		<link>https://www.gentoo-zh.org/viewtopic.php?id=322</link>
		<description><![CDATA[C 练习实例13 - 水仙花数 最近发表的帖子。]]></description>
		<lastBuildDate>Mon, 29 Aug 2022 07:03:06 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[C 练习实例13 - 水仙花数]]></title>
			<link>https://www.gentoo-zh.org/viewtopic.php?pid=328#p328</link>
			<description><![CDATA[<p>题目：打印出所有的&quot;水仙花数&quot;，所谓&quot;水仙花数&quot;是指一个三位数，其各位数字立方和等于该数 本身。例如：153是一个&quot;水仙花数&quot;，因为153=1的三次方＋5的三次方＋3的三次方。</p><p>程序分析：利用for循环控制100-999个数，每个数分解出个位，十位，百位。</p><p>#include&lt;stdio.h&gt;</p><p>int main()<br />{<br />&#160; &#160; int i,x,y,z;<br />&#160; &#160; for(i=100;i&lt;1000;i++)<br />&#160; &#160; {<br />&#160; &#160; &#160; &#160; x=i%10;<br />&#160; &#160; &#160; &#160; y=i/10%10;<br />&#160; &#160; &#160; &#160; z=i/100%10;<br />&#160; &#160; &#160; &#160; <br />&#160; &#160; &#160; &#160; if(i==(x*x*x+y*y*y+z*z*z))<br />&#160; &#160; &#160; &#160; printf(&quot;%d\n&quot;,i);<br />&#160; &#160; &#160; &#160; <br />&#160; &#160; }<br />&#160; &#160; return 0;<br />}</p>]]></description>
			<author><![CDATA[dummy@example.com (batsom)]]></author>
			<pubDate>Mon, 29 Aug 2022 07:03:06 +0000</pubDate>
			<guid>https://www.gentoo-zh.org/viewtopic.php?pid=328#p328</guid>
		</item>
	</channel>
</rss>
