Cod sursa(job #237188)

Utilizator shnakoVlad Schnakovszki shnako Data 29 decembrie 2008 11:11:17
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.39 kb
#include <stdio.h>
#include <ctype.h>
int s=0, c;
bool sw=0, swx;
char x;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);

while(!feof(stdin))
	{
   swx=0;
   x=fgetc(stdin);
   if (isalpha(x))
   	{
      swx=1;
      sw=1;
    	s++;
      }
   else
   	if (sw&&!swx)
   	{
      sw=0;
      c++;
      }
   }
printf("%d", s/c);
return 0;
}