Cod sursa(job #276985)

Utilizator beyond_k7aOnutu Catalin beyond_k7a Data 11 martie 2009 14:10:09
Problema Text Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.37 kb
#include<fstream.h>
#include<string.h>
#include<ctype.h>
char x[64001];
int n,ok,c,i,m;
int main()
{
 ifstream f("text.in");
 ofstream g("text.out");
 m=0;
 while(f.getline(x,64000))
 {
  n=strlen(x);
  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;
}