Cod sursa(job #778925)

Utilizator slyfer12Damian Alexandru slyfer12 Data 16 august 2012 11:45:40
Problema Text Scor 70
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.37 kb
#include <fstream>
#include <ctype.h>

using namespace std;

int main()
{ char x;
  int cuv=0,lit=0,t=0;
 ifstream f("text.in");
 ofstream g("text.out");
   while(!f.eof()){
       f.get(x);
       if(isalpha(x))
       {lit++;
       t=1;}
         else
           if(isspace(x)&& t)
           {cuv++;
           t=0;}}

    g<<lit/cuv;
    return 0;
}