用 for(char i='A';i<='Z';++i),利用ASCLL码的特性
字母统计
http://www.nowcoder.com/questionTerminal/de7bf0945c1c4bd1aa9d49573b831f3c
include
include
include
using namespace std;
int main(){
string str;
while(getline(cin,str)){//循环输入一行
for(char i='A';i<='Z';++i){ //从a到z循环
int sum=0;
for(int j=0;j<str.size();++j){
if(i==str[j]){
sum++;
}
}
cout<<i<<":"<<sum<<endl;
} } return 0;
}