Pagini recente » Cod sursa (job #1686591) | Cod sursa (job #2004261) | Cod sursa (job #1760431) | Cod sursa (job #595847) | Cod sursa (job #236985)
Cod sursa(job #236985)
#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);
x=fgetc(stdin);
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;
}