Cod sursa(job #304232)
Utilizator | Data | 11 aprilie 2009 15:40:29 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.43 kb |
#include<stdio.h>
#include<ctype.h>
int main()
{
char x=0;
int sw=0,s=0,c=0;
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
while(!feof(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;
return 0;
}