Cod sursa(job #1525762)

Utilizator glod_georgeGlod George-Daniel glod_george Data 15 noiembrie 2015 15:53:14
Problema Text Scor 10
Compilator cpp Status done
Runda 11A Marime 0.46 kb
#include <iostream>
#include <fstream>
#include <cstring>

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

int main()
{
    bool ok=0;
    int s,k;
    s=k=0;
    char cuv;
    while(fin.get(cuv))
    {
        if(isalpha(cuv))
        {
            s++;
            ok=1;
        }
        else if(!isalpha(cuv));
        {
            if(ok==1)k++;
            ok=0;
        }
    }
    fout<< s/k;
    return 0;
}