<?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=339&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Gentoo中文社区 / C 练习实例30 - 回文数]]></title>
		<link>https://www.gentoo-zh.org/viewtopic.php?id=339</link>
		<description><![CDATA[C 练习实例30 - 回文数 最近发表的帖子。]]></description>
		<lastBuildDate>Mon, 29 Aug 2022 07:12:09 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[C 练习实例30 - 回文数]]></title>
			<link>https://www.gentoo-zh.org/viewtopic.php?pid=345#p345</link>
			<description><![CDATA[<p>题目：一个5位数，判断它是不是回文数。即12321是回文数，个位与万位相同，十位与千位相同。</p><p>程序分析：学会分解出每一位数。</p><p>程序源代码：</p><p>#include &lt;stdio.h&gt;</p><p>int main( )<br />{<br />&#160; &#160; long ge,shi,qian,wan,x;<br />&#160; &#160; printf(&quot;请输入 5 位数字：&quot;);<br />&#160; &#160; scanf(&quot;%ld&quot;,&amp;x);<br />&#160; &#160; wan=x/10000;&#160; &#160; &#160; &#160; /*分解出万位*/<br />&#160; &#160; qian=x%10000/1000;&#160; /*分解出千位*/<br />&#160; &#160; shi=x%100/10;&#160; &#160; &#160; &#160;/*分解出十位*/<br />&#160; &#160; ge=x%10;&#160; &#160; &#160; &#160; &#160; &#160; /*分解出个位*/<br />&#160; &#160; if (ge==wan&amp;&amp;shi==qian) { /*个位等于万位并且十位等于千位*/<br />&#160; &#160; &#160; &#160; printf(&quot;这是回文数\n&quot;);<br />&#160; &#160; } else {<br />&#160; &#160; &#160; &#160; printf(&quot;这不是回文数\n&quot;);<br />&#160; &#160; }<br />}</p>]]></description>
			<author><![CDATA[dummy@example.com (batsom)]]></author>
			<pubDate>Mon, 29 Aug 2022 07:12:09 +0000</pubDate>
			<guid>https://www.gentoo-zh.org/viewtopic.php?pid=345#p345</guid>
		</item>
	</channel>
</rss>
