Cod sursa(job #1288755)

Utilizator Mihai_BogdanDumitru Mihai Mihai_Bogdan Data 9 decembrie 2014 01:22:35
Problema Text Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.42 kb
//http://www.infoarena.ro/problema/text
#include<stdio.h>
#include<cstring>
#include<fstream>
using namespace std;

int main()
{
 long k=0,k1=0,k2=0;
 char c;
 ifstream f("text.in");
 ofstream g("text.out");
 while(!f.eof())
 {
  f>>c;
    if(isalpha(c))
    {
     k1++;
     if(k==0)
     {
      k2++;
      k=-1;
     }
    }
  else
    k=0;
 }
 g<<k1/k2;
 f.close();
 g.close();
 return 0;
}