做二手物资哪个网站好,网站精准ip接口怎么做,p2p网贷网站建设方案,微信网站需要备案吗输入一行字符#xff0c;分别统计出包含英文字母、空格、数字和其它字符的个数。 数据范围#xff1a;输入的字符串长度满足1≤n≤1000
输入描述#xff1a;输入一行字符串#xff0c;可以有空格 输出描述#xff1a;统计其中英文字符#xff0c;空格字符#xff0c;数…输入一行字符分别统计出包含英文字母、空格、数字和其它字符的个数。 数据范围输入的字符串长度满足1≤n≤1000
输入描述输入一行字符串可以有空格 输出描述统计其中英文字符空格字符数字字符其他字符的个数
输入1qazxsw23 edcvfr45tgbn hy67uj m,ki89ol.\/;p0-\][ 输出 26 3 10 12
#includestdio.h
#includestring.h
int main() {char str[1001] {\0};while (gets(str)) {int len strlen(str);int charac 0, blank 0, num 0, other 0;for (int i len - 1; i 0; i--) {//字母计数区分大小写if (((a str[i])(str[i] z)) || ((A str[i])(str[i] Z))) charac;else if (str[i] ) blank; //空格计数else if ((0 str[i]) (str[i] 9)) num; //数字计数else other; //其他字符计数}printf(%d\n%d\n%d\n%d\n, charac, blank, num, other);}
}