Pagini recente » Cod sursa (job #1734392) | Cod sursa (job #2347952) | Cod sursa (job #899182) | Cod sursa (job #890815) | Cod sursa (job #329402)
Cod sursa(job #329402)
#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;
}