Cod sursa(job #1209692)

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

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

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

int main()
{
    while ( fin>> s )
    {
        if ( isalpha(s) )
        {
            if ( !ok )
            {
                ok = true;
                lit++;
                cuv++;
            }
            else
                lit++;
        }
        else
            ok = false;

    }
    fout << lit / cuv << '\n';

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