您当前的位置: 首页 >  c++

C++:统计字符串内大小写字母,数字空格,逗号等

川川菜鸟 发布时间:2020-12-09 17:35:54 ,浏览量:4

原题: 用赋初值的方法把字符串 “ C is a general purpose, procedural, imperative computer programming language developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system.” 存放到字符数组s中,编程统计其中的大写字母、小写字母、数字、空格、逗号的个数。

代码:

#include
using namespace std;

int main()

{
	char c;
	int smallletters = 0, largeletters=0,space = 0, digit = 0,douhao=0, other = 0;
	cout             
关注
打赏
1688896170
查看更多评论
0.0514s