<?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=379&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Gentoo-zh / C 练习实例70]]></title>
		<link>http://www.gentoo-zh.org/viewtopic.php?id=379</link>
		<description><![CDATA[C 练习实例70 最近发表的帖子。]]></description>
		<lastBuildDate>Mon, 29 Aug 2022 11:41:54 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[C 练习实例70]]></title>
			<link>http://www.gentoo-zh.org/viewtopic.php?pid=385#p385</link>
			<description><![CDATA[<p>题目：写一个函数，求一个字符串的长度，在 main 函数中输入字符串，并输出其长度。</p><p>程序分析：无。</p><div class="codebox"><pre><code> 
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
int main()
{
    int len;
    char str[20];
    printf(&quot;请输入字符串:\n&quot;);
    scanf(&quot;%s&quot;,str);
    len=length(str);
    printf(&quot;字符串有 %d 个字符。&quot;,len);
}
//求字符串长度  
int length(char *s)  
{  
    int i=0;
    while(*s!=&#039;\0&#039;)
    {  
        i++;   
        s++;  
    }  
    return i;  
}</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (batsom)]]></author>
			<pubDate>Mon, 29 Aug 2022 11:41:54 +0000</pubDate>
			<guid>http://www.gentoo-zh.org/viewtopic.php?pid=385#p385</guid>
		</item>
	</channel>
</rss>
