- 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;
- }
-
相关阅读:
(最新版2022版)剑指offer之树和二叉树题解
有哪些免费的PPT模板网站,推荐这6个PPT模板免费下载网站!
Flink Data Transformation
数据结构·顺序表
SpringCloud-Eureka-介绍+非集群式搭建
外包干了10天,技术退步明显。。。。。
linux中Crontab定时参数
利用大模型MoritzLaurer/mDeBERTa-v3-base-xnli-multilingual-nli-2mil7实现零样本分类
数据库系统及应用复习——第十章数据库恢复技术与第十一章并发调度的可串行性
如何让照片动起来?几个制作方法和注意事项分享
-
原文地址:https://blog.csdn.net/qiujunhang/article/details/133654359