- int main()
- {
- string str;
- cout << "输入字符串:";
- getline(cin,str);
- int size =str.size();
- int big = 0;
- int small = 0;
- int num = 0;
- int space = 0;
- int other = 0;
- for(int i=0;i
- {
- if(str[i]<='Z'&&str[i]>='A')
- {
- big++;
- }
- else if(str[i]<='z'&&str[i]>='a')
- {
- small++;
- }
- else if(str[i]<='9'&&str[i]>='0')
- {
- num++;
- }
- else if(str[i]==' ')
- {
- space++;
- }
- else
- other++;
- }
- cout << "big=" << big << endl;
- cout << "small=" << small << endl;
- cout << "num=" << num << endl;
- cout << "space=" << space <
- cout << "other=" << other <
-
-
- return 0;
- }
-
相关阅读:
SpringTask ----定时任务框架 ----苍穹外卖day10
105、python-第四阶段-2-装饰器
从0到1搭建数据中台(3):flinkcdc实现数据从mysql到doris
MIMO检测
HDFS 联邦
[附源码]java毕业设计高校创新创业项目管理系统
浅谈 @Autowired 和 @Resource 的区别
OpenCV(opencv_apps)在ROS中的视频图像的应用(重点讲解哈里斯角点的检测)
STM32 CAN过滤器标识符学习笔记
Hadoop3教程(二十九):(生产调优篇)集群扩容及缩容(白名单与黑名单)
-
原文地址:https://blog.csdn.net/qiujunhang/article/details/133654359