#include <iostream>
#include <string>
using namespace std;
int main()
{
int Upper=0;
string SenTence;
cout<<"请输入字符: "<<endl;
getline(cin, SenTence, '\n');
for (int i=1;i<SenTence.length();i++)
{
if (isspace(SenTence[i]))
Upper++;
}
cout<<Upper+1<<endl;
return 0;
}
统计空格数目
最新推荐文章于 2023-04-18 22:16:59 发布