#include<cstdio> #include<string.h> using namespace std; int main() { char s[100000]; int a[125]; while (gets(s)) { memset(a,0,sizeof(a)); int l=strlen(s); for (int i=0;i<l;i++) { if ((s[i]>64 && s[i]<91) || (s[i]>96 &&s[i]<123)) a[s[i]]++; } int max=0; for (int i=65;i<123;i++) if (max<a[i]) max=a[i]; for (int i=65;i<123;i++) if (a[i]==max) printf("%c",i); printf(" %d\n",max); } return 0; }
Monday, May 2, 2016
UVA. 499 - What's The Frequency, Kenneth? -solution
Unknown
Studying at Shahjalal University of Science and Technology, Sylhet.
Subscribe to:
Post Comments (Atom)
I have also implemented it. But looking at your code, I am just feeling "WOW!!!"....
ReplyDeletehttps://pastebin.com/BAQ6es8H