Pagini recente » Cod sursa (job #416404) | Cod sursa (job #363310) | Cod sursa (job #1936078) | Cod sursa (job #2313826) | Cod sursa (job #329400)
Cod sursa(job #329400)
#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;
}