Cod sursa(job #1011138)

Utilizator andreimdvMoldovan Andrei andreimdv Data 16 octombrie 2013 11:37:10
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.39 kb
#include<fstream>
#include<cstring>
using namespace std;

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

char c;
int lung,ok,nr;
int main()
{
    while(fin.get(c))
    {
        if(isalpha(c))
        {
            lung++;
            ok=1;
        }
        else
        if(ok==1)
        {
            nr++; ok=0;
        }
    }
    fout<<lung/nr;
    return 0;
}