Cod sursa(job #236844)

Utilizator shnakoVlad Schnakovszki shnako Data 28 decembrie 2008 17:02:44
Problema Text Scor 70
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.38 kb
#include <stdio.h>
#include <ctype.h>
int s=0, c;
bool sw;
char x;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
while(scanf("%c", &x)!=EOF)
	{
   sw=1;
   while (!isalpha(x)&&!EOF)
   	scanf("%c", &x);
	while (isalpha(x))
   	{
      sw=0;
   	s++;
      scanf("%c", &x);
      }
   if (sw==0)
   c++;
   }
printf("%d", s/c);
return 0;
}