Cod sursa(job #778930)

Utilizator slyfer12Damian Alexandru slyfer12 Data 16 august 2012 11:55:20
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.38 kb
#include <fstream>
#include <ctype.h>
#include <string.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(t)
           {cuv++;
           t=0;}}

    g<<lit/cuv;
    return 0;
}