Cod sursa(job #1892974)

Utilizator pSergiuPatras Sergiu pSergiu Data 25 februarie 2017 13:39:31
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.44 kb
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
int main()
{

    ifstream fin("text.in");
    ofstream fout("text.out");
    char x;
    int ok=0,lit=0,cuv=0;
    while(fin.get(x)){
        if(isalpha(x)) {
                lit++;
                ok=1;}
        else if(!isalpha(x) && ok) {
                cuv++;
                ok=0;

        }

    }
    fout<<lit/cuv;

    return 0;
}