Cod sursa(job #349532)

Utilizator TFifesPorcescu Alexandru TFifes Data 19 septembrie 2009 23:42:09
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.48 kb
#include<iostream>
#include<fstream>
#include<ctype.h>
using namespace std;
int main ()
{
    ifstream x("text.in");
    ofstream y("text.out");
    char c;
    unsigned int nr=0,cv=0;
    while(!x.eof())
    {
        c=x.get();
        if(isalpha(c))
        {
        while(isalpha(c) && !x.eof())
        {
            nr++;
            c=x.get();
        }
        cv++;
        }
    }


    x.close();
  if(cv!=0)
  y<<nr/cv;
  y.close();
    return 0;
}