编写函数统计输入字符的个数.
编写函数统计输入字符的个数,用@字符结束输入。在主函数中调用此函数,输出统计结果。
程序代码:#include"stdio.h"
long countch();
main()
{
long n;
n=countch();
printf("n=%ld\n",n);
}
long countch()
{
long cn;
for(cn=0;getchar()!='@';cn++);
return cn;
}看看这个可以吧!








可以满!