Cod sursa(job #858592)
Utilizator | Data | 19 ianuarie 2013 01:09:25 | |
---|---|---|---|
Problema | Text | Scor | 90 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
#include<cstdio>
#include<cstring>
char c;
int lit,sum,word;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
while(scanf("%c",&c)>0)
{
if(c>='A'&&c<='z')
lit++;
else
if(lit)
sum+=lit,word++,lit=0;
}
printf("%d\n",sum/word);
return 0;
}