Untitled
raw download clone
CPP
views 15
,
size 495 b
#include <iostream>
#include <cstring>
using namespace std;

int main()
{
    int f[26]={0}, max=0;
    char linie[256];
    char litera;
    cin.getline(linie, 256);
    for(unsigned int i=0; i<strlen(linie); i++)
            if(linie[i] >= 97 && linie [i] <= 122)
                    f[linie[i]-97]++;
    for (unsigned int i=0; i<25; i++)
        if (f[i]>max)
        {
            max=f[i];
            litera=(char)(i+97);
        }
    cout << litera;
    return 0;
}
close fullscreen
Login or Register to edit or fork this paste. It's free.