Cod sursa(job #276977)

Utilizator beyond_k7aOnutu Catalin beyond_k7a Data 11 martie 2009 14:06:41
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.36 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=0;
 m=0;
 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;
}