Cod sursa(job #237198)

Utilizator shnakoVlad Schnakovszki shnako Data 29 decembrie 2008 11:34:56
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.45 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;  
}