Cod sursa(job #1209695)

Utilizator blackoddAxinie Razvan blackodd Data 18 iulie 2014 12:44:53
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.55 kb
#include <fstream>
#include <cstring>
#include <cctype>
using namespace std;

ifstream fin("text.in");
ofstream fout("text.out");

char s;
int lit, cuv, ok = 0;

int main()
{
    while ( fin.get(s) )
    {
        if ( isalpha(s) )
        {
            if ( !ok )
            {
                ok = 1;
                lit++;
                cuv++;
            }
            else
                lit++;
        }
        else
            ok = 0;

    }
    fout << lit / cuv;

    fin.close();
    fout.close();
    return 0;
}