#include<iostream> using namespace std; int main() { char str[100]; int i=0,word=0,number=0,black=0,other=0; cin.getline(str,100); while(str[i]!='\0') { if(str[i]>='A'&&str[i]<='Z'||str[i]>='a'&&str[i]<='z') word++; else if(str[i]>='0'&&str[i]<='9') number++; else if(str[i]==' ') black++; else other++; i++; } cout<<word<<' '<<number<<' '<<black<<' '<<other; return 0; }
0.0分
0 人评分
母牛的故事 (C语言代码)浏览:1300 |
C语言程序设计教程(第三版)课后习题8.3 (Java代码)浏览:1372 |
C语言程序设计教程(第三版)课后习题6.3 (C语言代码)浏览:946 |
C语言程序设计教程(第三版)课后习题7.3 (C语言代码)浏览:1195 |
C语言程序设计教程(第三版)课后习题6.8 (C++代码)浏览:587 |
C语言程序设计教程(第三版)课后习题8.9 (C语言代码)浏览:832 |
文科生的悲哀 (C语言代码)浏览:1401 |
C语言程序设计教程(第三版)课后习题10.1 (C语言代码)浏览:535 |
数列排序 (C语言代码)浏览:616 |
众数问题 (C语言代码)浏览:673 |