Pagini recente » Cod sursa (job #2064198) | Cod sursa (job #2310992) | Cod sursa (job #808852) | Cod sursa (job #1110253) | Cod sursa (job #329405)
Cod sursa(job #329405)
#include <stdio.h>
#include <ctype.h>
#define DIM 1000001
int lgt,nrc,n;
char p[DIM];
void read_solve ()
{
int lg;
for (lg=0; scanf ("%c",&p[++n])!=EOF; )
{
if (isalpha (p[n]))
++lg;
else if (lg)
{
lgt+=lg;
lg=0;
++nrc;
}
}
if (lg)
{
++nrc;
lgt+=lg;
}
printf ("%d",lgt/nrc);
}
int main ()
{
freopen ("text.in","r",stdin);
freopen ("text.out","w",stdout);
read_solve ();
return 0;
}