深圳营销型网站建设公司网络服务,北京综评网址,刷赞网站推广免费软件,templates怎么读1.思维导图 2.提示并输入一个字符串#xff0c;统计该字符中大写、小写字母个数、数字个数、空格个数以及其他字符个数#xff0c;要求使用C风格字符串完成
#include iostreamusing namespace std;int main()
{string str;cout 请输入一个字符串统计该字符中大写、小写字母个数、数字个数、空格个数以及其他字符个数要求使用C风格字符串完成
#include iostreamusing namespace std;int main()
{string str;cout 请输入一个字符串 endl;getline(cin,str);int big 0, small 0, num 0, space 0,other 0, size str.size();for(int i0;isize;i){if(str[i]A str[i]Z)big;else if(str[i]a str[i]z)small;else if(str[i]0 str[i]9)num;else if(str[i] )space;elseother;}cout 大写字母个数 big endl;cout 小写字母个数 small endl;cout 数字个数 num endl;cout 空格个数 space endl;cout 其他字符个数 other endl;return 0;
}