Cod sursa(job #264325)

Utilizator ghitzZzaGheorghita Hurmuz ghitzZza Data 21 februarie 2009 21:48:11
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.42 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(x=fgetc(stdin))  
	{
   sw=1;
   while (!isalpha(x)&&!feof(stdin))
   	x=fgetc(stdin);
   while (isalpha(x)&&!feof(stdin))
   	{
      sw=0;
    	s++;
      x=fgetc(stdin);
      }
   if (sw==0)
   	c++;
   }
printf("%d", s/c);  
return 0;  
}