Cod sursa(job #1041418)

Utilizator Iustin_BulimarFMI Iustin Bulimar Iustin_Bulimar Data 25 noiembrie 2013 20:07:19
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.53 kb
#include <fstream>
#include <cstring>
using namespace std;
ifstream cin("text.in");
ofstream cout("text.out");

char s[20000000];
int m, l, i, j, n, k;

bool litera(char c)
{
    return ((c>='a' && c<='z') || (c>='A' && c<='Z'));
}
int main()
{
    cin.get(s, 20000000);
    l=strlen(s);
    while(i<l)
        if(litera(s[i]))
        {
            n++;
            k++;
            j=i+1;
            while(litera(s[j]) && j<l) j++, k++;
            i=j;
        }
        else i++;
    cout<<k/n;
    return 0;
}