#include<iostream>
#include<string>
using namespace std;
int main(){
string s;
int *a = new int[26];
for(int k =0;k < 26;k++)
a[k] = 0;
int i,j;
while(cin>>s)
{
for(i = 0;i < s.length();i++)
{
if(s[i] != '#')
a[(char)s[i] - 97]++;
}
if(s[i-1] == '#')
for( j =0;j < 26;j++)
cout<<(char)(j + 97)<<" "<<a[j]<<endl;
}
return 0;
}
#include<string>
using namespace std;
int main(){
string s;
int *a = new int[26];
for(int k =0;k < 26;k++)
a[k] = 0;
int i,j;
while(cin>>s)
{
for(i = 0;i < s.length();i++)
{
if(s[i] != '#')
a[(char)s[i] - 97]++;
}
if(s[i-1] == '#')
for( j =0;j < 26;j++)
cout<<(char)(j + 97)<<" "<<a[j]<<endl;
}
return 0;
}
a[(char)s[i] - 97]++;
典型的统计字母的方法!!!
cout<<(char)(j + 97)<<" "<<a[j]<<endl;