Cod sursa(job #277006)

Utilizator beyond_k7aOnutu Catalin beyond_k7a Data 11 martie 2009 14:18:26
Problema Text Scor 90
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.41 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))
 {
  i=0;
  n=strlen(x);
  while(i<n)
  {
	ok=0;
	while(isalpha(x[i]))
	{
	 m++;
	 i++;
	 ok=1;
	}
	if(ok)
	 c++;
	i++;
  }
 }
 if(c==0)
  g<<m;
 else
  g<<m/c;
 f.close();
 g.close();
 return 0;
}