Cod sursa(job #2201422)

Utilizator PushkinPetolea Cosmin Pushkin Data 4 mai 2018 18:22:27
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.38 kb
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char c;
inline bool lit(char c)
{
    return ('a'<=c&&c<='z')||('A'<=c&&c<='Z');
}
int main()
{
    int n=0, l=0;
    f>>noskipws;
    while(f>>c)if(lit(c))
    {
        l++;
        while(f>>c&&lit(c))l++;
        n++;
    }
    g<<l/n;
    return 0;
}