int main()//随机输入字符串判断的字符个数
{
char Ch[100] = {'0'};
int index=0,i=0;
gets(Ch);
for (i = 0; Ch[i] != '\0'; i++)//字符串以\0为结束标志
{
index++;
}
printf("%d", index);
return 0;
}
判断字符串中字符的个数
最新推荐文章于 2024-07-06 15:15:17 发布