Cod sursa(job #988404)

Utilizator lucianzr1Boaca Lucian lucianzr1 Data 22 august 2013 19:12:57
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.53 kb
#include <iostream>
#include <fstream>


using namespace std;
int main()
{
    fstream dataFile;
    dataFile.open("date_intrare.txt", ios::in);

    int lit=0, cuv=0;
    bool ok;
    char ch;

    ok=false;

    while(!dataFile.eof())
    {
        dataFile.get(ch);
        if(isalpha(ch)==0 && ok==true)
            {
                cuv++; ok==false;
            }
        else if(isalpha(ch))
                {
                    lit++; ok=true;
                }
    }

    cout<<lit/cuv;
    return 0;
}