Cod sursa(job #269095)

Utilizator beyond_k7aOnutu Catalin beyond_k7a Data 2 martie 2009 13:43:20
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.37 kb
#include<fstream.h>
#include<string.h>
#include<ctype.h>
char x[8001];
int n,ok,c,i,m;
int main()
{
 ifstream f("text.in");
 ofstream g("text.out");
 f.getline(x,8000);
 n=strlen(x);
 i=1;
 m=1;
 while(i<n)
 {
  ok=0;
  while(isalpha(x[i]))
  {
   m++;
   i++;
   ok=1;
  }
  if(ok)
   c++;
  i++;
 }
 g<<m/c;

 f.close();
 g.close();
 return 0;
}