#include<stdio.h> int main() { int c, space ,number ,character , other; space = number = character = other =0; while( (c = getchar())!='\n') { if( c == ' ') { space++; } else if( c >='0'&& c <='9') { number++; } else if ( (c >='a' && c <= 'z') || ( c >= 'A' && c <= 'Z') ) { character++; } else { other++; } } printf("%d %d %d %d",character,space,number,other); return 0; }
0.0分
7 人评分
C语言训练-求1+2!+3!+...+N!的和 (C语言代码)浏览:2422 |
C二级辅导-等差数列 (C语言代码)浏览:1179 |
永远的丰碑 (C语言代码)浏览:587 |
C语言程序设计教程(第三版)课后习题4.9 (C语言代码)浏览:671 |
C语言训练-斐波纳契数列 (C语言代码)浏览:985 |
矩阵乘法 (C++代码)浏览:1405 |
C语言程序设计教程(第三版)课后习题11.1 (C语言代码)浏览:646 |
敲七 (C++代码)浏览:978 |
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:423 |
小O的数字 (C语言代码)浏览:1372 |