Brief description :
求出現次數最多的一個子串。
Analyse :
這是個水題。。。因為統計出出現次數最多的單個字元即可。#
/*
Author : xiaodao
Prob : URAL 1723. Sandro's Book
Status : Accepted
Last Modify : GMT +8 Sept 16th 11:28
Tags : string algorithms
*/
#include
#include
using namespace std;
const int m = 256;
string s; int c[m], i, n;
int key; char ans;
int main(){
while (cin >> s){
key = 0; n = s.size();
memset(c, 0, sizeof(c));
for (i=0;i key){
key = c[s[i]];
ans = s[i];
}
}
cout << ans << endl;
}
}