#include <iostream>using namespace std;int main()
{string str;cout << "请输入字符串:";getline(cin,str);int big=0,little=0,spac=0,num=0,sym=0;int size=str.size();for(int i=0;i<size;i++){if((int)str.at(i)<65+26 && (int)str.at(i)>65){big++;}if((int)str.at(i)<97+26 && (int)str.at(i)>97){little++;}if(str.at(i)>'0' && str.at(i)<'9'){num++;}if(' '==str.at(i)){spac++;}}cout << "big= " << big << " ";cout << "little= " << little << " ";cout << "spac= " << spac << " ";cout << "num= " << num << " ";cout << "sym= " << str.size()-big-little-spac-num << " ";cout << endl;return 0;
}