当前位置: 首页 > news >正文

C++day01(QT简介、C++)

今日任务:

代码:

#include <iostream>using namespace std;int main()
{/** 输入字符串统计大写、小写、数字、空格以及其他字符的个数**/string s;cout << "请输入一个字符串" << endl;//cin >> s;getline(cin,s);int small=0,big=0,number=0,space=0,other=0;for(int i=0;i<(int)s.size();i++){cout << s[i] <<endl;if('a'<=s[i]&& s[i]<='z'){small++;}else if('A'<=s[i]&& s[i]<='Z'){big++;}else if(0<=s[i]&& s[i]<=9){number++;}else if(s[i]==' '){space++;}else{other++;}}cout << "small=" << small << " big=" << big << " number=" << number << "space" << space<< " other=" << other <<endl;return 0;
}

运行结果:

今日思维导图

http://www.lryc.cn/news/184481.html

相关文章:

  • Web server failed to start. Port 8080 was already in use
  • new和malloc的区别
  • python:openpyxl 读取 Excel文件,显示在 wx.grid 表格中
  • 12P2532X152 KJ3222X1-BA1 CE4003S2B1 EMERSON DELTAV
  • P1014 [NOIP1999 普及组] Cantor 表
  • JMeter性能分析实战一:日常登录接口
  • 内外网结合的多服务发布架构
  • Unity中Shader的光照模型Lambert
  • (一)Log4Net - 介绍
  • [bug] mysql 时间与本地不一致
  • 【改造先序遍历】222. 完全二叉树的节点个数
  • windows文件和目录相关命令
  • TL-ER3220G端口映射设置
  • MySQL Cluster
  • Spring封装的原生WebSocket使用,带组的实现
  • Linux高性能服务器编程 学习笔记 第十一章 定时器
  • jenkins拉取git代码 code 128解决方案
  • 【Linux】 ls命令使用
  • 【CVE-2023-35843】NocoDB 任意文件读取漏洞
  • 在 ubuntu 22.04 上配置界面服务器 vnc
  • 强化学习------Sarsa算法
  • [HNCTF 2022 WEEK2]easy_unser - 反序列化+wakeup绕过+目录绕过
  • FastThreadLocal 快在哪里 ?
  • ggkegg | 用这个神包玩转kegg数据库吧!~(一)
  • 【小黑送书—第三期】>>《深入浅出SSD》
  • linux虚拟机查看防火墙状态
  • Docker 安装 MongoDB
  • c++解压压缩包文件
  • MySql学习笔记:MySql性能优化
  • 机器学习(四十八):粒子群优化(PSO)-提升机器学习模型准确率的秘密武器