- #include
- using namespace std;
- int main(){
- string line;
- int i,len;
- int space=0,number=0,character=0,other=0;
- getline(cin,line);
- len=line.length();
-
- for(i=0;i
-
- if(line[i]==' '){ //字符ch为空' '
- space++;
- }
- else if(line[i]>='0'&&line[i]<='9'){ //字符为数字0~9
- number++;
- }
- else if(line[i]>='a'&&line[i]<='z'||line[i]>='A'&&line[i]<='Z'){ //字符为字母a~z,A~Z
- character++;
- }
- else{
- other++;
- }
-
-
- }
-
-
相关阅读:
Python 运算符重载Demo
java基础10题
ESB(企业服务总线)
Linux—软件管理
java基于微信小程序校园二手闲置商品交易跳蚤市场 uniapp 小程序
线下门店如何根据员工排班情况给客户预约
HAproxy
day03-2无异常退出
并查集与最小生成树
Alien Skin Exposure8免费版PS图片滤镜插件
-
原文地址:https://blog.csdn.net/weixin_46061083/article/details/127597799