------------只要够努力,人生最坏的结局不过是大器晚成!!!

#include <iostream>
#include <cstring>
using namespace std;

int main(){
    string str;
    int a[200] = {0};
    
//    cin >> str;
    getline(cin, str);
    for(int i = 0; i < str.length(); i++){
        if(str[i] >= 'a' && str[i] <= 'z')
            a[str[i]]++;
        if(str[i] >= 'A' && str[i] <= 'Z')
            a[str[i] + 32]++;            
    }
    int max = 90;
    for(int i = 'a'; i <= 'z'; i++)
        if(a[max] < a[i])
            max = i;
    cout << (char)max << " " << a[max];
    return 0;
}

posted on 2017-07-23 16:01  ystraw  阅读(645)  评论(0)    收藏  举报

不经一番切孤寒,怎得梅花扑鼻香