Cod sursa(job #1525782)

Utilizator AlexAndriesAlexandru Andries AlexAndries Data 15 noiembrie 2015 16:18:48
Problema Text Scor 100
Compilator cpp Status done
Runda 11A Marime 0.41 kb
#include <fstream>
#include <cstring>

using namespace std;

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

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