Cod sursa(job #228264)
Utilizator | Data | 6 decembrie 2008 20:26:43 | |
---|---|---|---|
Problema | Text | Scor | 90 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.5 kb |
#include <stdio.h>
#define Size 1000000
char c[Size];
void Read()
{
int x=0,pozi=0,pozf=0,sum=0,nc=0,ok=0;
scanf("%c",&c[x]);
while (c[x]!='\0')
{
if ((65<=c[x]&&c[x]<=90)|(97<=c[x]&&c[x]<=122))
{
ok++;
pozf++;
}
else
{
if (ok)
{
sum+=pozf-pozi;
nc++;
}
ok=0;
pozi=pozf+1;
pozf=pozi;
}
scanf("%c",&c[++x]);
}
printf("%d\n",sum/nc);
}
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
Read();
}