编写一个函数,由实际参数传过来一个字符串,统计此字符串中字符,数字,空格和其他字符的个数,在主函数

日期:2010-12-24 19:09:31 人气:1

编写一个函数,由实际参数传过来一个字符串,统计此字符串中字符,数字,空格和其他字符的个数,在主函数

#include #include #define size 100 void main(){ char x[size],c,*p; int ch,num,kongge,other; p=x; ch=num=kongge=other=0; printf("input a chars:"); gets(x); while(*p){ c=*p; p++; if(c==' ') kongge++; else if(c>
    A+
热门评论