字符统计
Time Limit: 1 Sec Memory Limit: 64 MBSubmit: 421 Solved: 92
[Submit][Status][Web Board]
Description
给出一串字符,要求统计出里面的字母、数字、空格以及其他字符的个数。字母:A, B, ..., Z、a, b, ..., z组成数字:0, 1, ..., 9 空格:" "(不包括引号) 剩下的可打印字符全为其他字符。
Input
测试数据有多组。每组数据为一行(长度不超过100000)。数据至文件结束(EOF)为止。
Output
每组输入对应一行输出。包括四个整数a b c d,分别代表字母、数字、空格和其他字符的个数。
Sample Input
A0 ,
Sample Output
1 1 1 1
HINT
1 #include <iostream> 2 #include <string> 3 #include <stdio.h> 4 using namespace std; 5 char s[10001]; 6 int main() 7 { 8 while( cin.getline(s,10001,' ')){ 9 int a=0,b=0,c=0,d=0; 10 for(int i=0;s[i]!='