#include<ctype.h>
#include<string.h>
#include<stdio.h>
#include<math.h>
int len(char *sp);
int main()
{
char s[110];
gets(s);
printf("%d",len(s));
return 0;
}
int len(char *sp)
{
int i,count=0;
for(i=0;sp[i]!=’\0’;i++)
{
if(sp[i]!=’ ')
count++;
}
return count;
}
1161 字符串长度(指针专题)
最新推荐文章于 2022-08-01 21:32:48 发布