1. C++, Tobias Fuchs

/* Author: Tobias Fuchs
* Problem: 499
* Verdict: Accepted
* Runtime: 0.000
*/

#include<stdlib.h>
#include<string.h>
#include<iostream>

#define NUM_FREQ (127-48)

static int frequencies[NUM_FREQ];

int main(int argc, char * argv[])
{
int index, nread, max_freq, freq;
int nbytes = 1000000;
char * input;
char c, exit;
exit = 0;
input = (char *)malloc(nbytes+1);
max_freq = 0;
while(!exit && (nread = getline(&input, (size_t*)&nbytes, stdin)))
{
if(nread <= 1) { exit = 1; }
else {
max_freq = 0;
for(index = 0; index < nread; ++index) {
c = input[index];
if(c >= 65 && c <= 90 || c >= 97 && c <= 122)
{
frequencies[c-48]++;
freq = frequencies[c-48];
if(freq > max_freq) max_freq = freq;
}
}
for(index = 0; index < NUM_FREQ; index++) {
if(frequencies[index] == max_freq) {
printf("%c", index+48);
}
frequencies[index] = 0;
}
printf(" %d\n", max_freq);
}
}

return 0;
}

2. C++, Evgeni Pavlidis

/* Author: Evgeni Pavlidis
* Problem: 499
* Verdict: Accepted
* Runtime: 0.000
*/

#include <iostream>
#include <string>

using namespace std;

int stat[255];
int m;

int main()
{
string s;
while(getline(cin,s))
{
for(int i = 0; i < 255; i++)
stat[i] = 0;

m = 0;
for(int i = 0; i < s.length(); i++)
{
if((s[i] < 'A' || s[i] > 'z') || (s[i] > 'Z' && s[i] < 'a'))
continue;
stat[s[i]]++;
if(stat[s[i]] > m)
m = stat[s[i]];
}

for(int i = 0; i < 255; i++)
if(stat[i] == m)
cout << (char)i;

cout << " " << m << endl;

}
}