Cod sursa(job #1041386)

Utilizator borcanirobertBorcani Robert borcanirobert Data 25 noiembrie 2013 19:43:02
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.54 kb
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
    char c;
    long long m = 0, cuv = 0, p;
    bool ok = false;
    while ( fin.get(c) != 0 )
    {
        if( ( c >= 'a' && c <= 'z' ) || ( c >= 'A' && c <= 'Z' ) )
        {
            m++;
            p = 1;
        }
        else
            if( p == 1 )
            {
                p = 0;
                cuv++;
            }
    }
    fout << m / cuv << '\n';
    fin.close();
    fout.close();
    return 0;
}