Pagini recente » Cod sursa (job #501082) | Cod sursa (job #864542) | Cod sursa (job #155322) | Cod sursa (job #727922) | Cod sursa (job #34230)
Cod sursa(job #34230)
#include<stdio.h>
int main()
{
long count=0,sum=0,current=0;
char c,sw=0;
freopen("text.in","r",stdin);
while(!feof(stdin))
{
scanf("%c",&c);
if((c>='a' && c<='z') || (c>='A' && c<='Z'))
{current++;sw=1;}
else
{
if(sw==1){sw=0;count++;sum+=current;current=0;}
}
}
fclose(stdin);
freopen("text.out","w",stdout);
printf("%ld",sum/count);
fclose(stdout);
return 0;
}