#include <iostream>
#include <string>
using namespace std;
int main ()
{
int yingwen=0,kongge=0,shuzi=0,qita=0;
string str;
getline(cin,str);
int len=str.size();
for(int i=0;i<len;i++)
if((str.at(i)>='a' && str.at(i)<='z') || (str.at(i)>='A' && str.at(i)<='Z'))
yingwen++;
else if(str.at(i)==' ')
kongge++;
else if(str.at(i)>='0' && str.at(i)<='9')
shuzi++;
else qita++;
cout<<yingwen<<endl;
cout<<kongge<<endl;
cout<<shuzi<<endl;
cout<<qita<<endl;
return 0;
}
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题10.5 (C语言代码)浏览:543 |
回文数(一) (C语言代码)浏览:728 |
printf基础练习2 (C语言代码)浏览:305 |
打水问题 (C语言代码)浏览:1063 |
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:505 |
简单的a+b (C语言代码)浏览:573 |
A+B for Input-Output Practice (VI) (C语言代码)浏览:552 |
C语言训练-亲密数 (C语言描述,反正怎么都能对)浏览:2155 |
C语言程序设计教程(第三版)课后习题9.4 (C语言代码)浏览:628 |
C语言程序设计教程(第三版)课后习题10.2 (C语言代码)浏览:678 |