NE


私信TA

用户名:dotcpp0710923

访问量:219

签 名:

等  级
排  名 17026
经  验 751
参赛次数 0
文章发表 10
年  龄 0
在职情况 学生
学  校 Zhengzhou University
专  业 软件工程

  自我简介:

TA的其他文章

解题思路:

注意事项:

参考代码:

#include<iostream>

using namespace std;

int main(void)

{

int num=0,space=0,word=0,other=0;

char input;

while((input=getchar())!='\n')

{

if(input>='0'&&input<='9')num++;

else if(input==' ')space++;

else if(input>='a'&&input<='z'||input>='A'&&input<='Z')word++;

else 

other++;

}

cout<<word<<" "<<num<<" "<<space<<" "<<other;

system("pause>0");

}


 

0.0分

0 人评分

  评论区