#include <iostream> #include <cstdio> using namespace std; int main(){ char chl[1000],ch2; int num[26],i,k; for(i=0;i<26;i++){ num[i]=0; } gets(chl); i=0; while(chl[i]!='\0'){ if(chl[i]>='a'&&chl[i]<='z'){ k=chl[i]-'a'; num[k]++; } i++; } for(i=0;i<26;i++){ ch2='a'+i; cout<<ch2<<';'<<num[i]<<' '; if(i%5==4)cout<<endl; } return 0; }
标签:std,26,int,字母,chl,include,统计 From: https://www.cnblogs.com/w6826301/p/17610663.html