#include"iostream"
using namespace std;
int main()
{
char string[10000];
int count = 0;
int word;
gets(string);
for(int i = 0; string[i] != '\0'; i++)
{
if(string[0] == '\0')
{
word = 0;
cout<<"There is no word."<<endl;
}
else
{
word = 1;
count++;
}
}
cout<<"该单词有"<<count<<"个字母"<<endl;
getchar();
return 0;
}
统计字符串中字母的字数
最新推荐文章于 2022-04-03 15:43:54 发布