|
|
back to boardAnotC (just laughing (ac)) Posted by D4nick 1 Jan 2019 01:38 I absolutely don't understand why you have so long answers :) #include <iostream> #include <string> using namespace std; int main() { string s; int counts, MaxCounts = 0; char MaxSymb; cin >> s; for (int i = 'A'; i <= 'z'; i++) { counts =count(s.begin(), s.end(), i); if (counts > MaxCounts) { MaxCounts = counts; MaxSymb = i; } } cout << MaxSymb; } |
|
|