<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://gentoo-zh.org/extern.php?action=feed&amp;tid=375&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Gentoo-zh / C 练习实例66]]></title>
		<link>http://www.gentoo-zh.org/viewtopic.php?id=375</link>
		<description><![CDATA[C 练习实例66 最近发表的帖子。]]></description>
		<lastBuildDate>Mon, 29 Aug 2022 11:39:27 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[C 练习实例66]]></title>
			<link>http://www.gentoo-zh.org/viewtopic.php?pid=381#p381</link>
			<description><![CDATA[<p>题目：输入3个数a,b,c，按大小顺序输出。</p><p>程序分析：利用指针方法。</p><div class="codebox"><pre><code># include&lt;stdio.h&gt;
 
void swap(int *, int *);
int main(void)
{
    int a, b, c;
    int *p1, *p2, *p3;
    printf(&quot;输入 a, b ,c:\n&quot;);
    scanf(&quot;%d %d %d&quot;, &amp;a, &amp;b, &amp;c);
    p1 = &amp;a;
    p2 = &amp;b;
    p3 = &amp;c;
    if(a&gt;b)
        swap(p1, p2);
    if(a&gt;c)
        swap(p1, p3);
    if(b&gt;c)
        swap(p2, p3);
    printf(&quot;%d %d %d\n&quot;, a, b, c);
}
void swap(int *s1, int *s2)
{
    int t;
    t = *s1; *s1 = *s2; *s2 = t;
}</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (batsom)]]></author>
			<pubDate>Mon, 29 Aug 2022 11:39:27 +0000</pubDate>
			<guid>http://www.gentoo-zh.org/viewtopic.php?pid=381#p381</guid>
		</item>
	</channel>
</rss>
