Cod sursa(job #489137)
Utilizator | Data | 1 octombrie 2010 12:54:59 | |
---|---|---|---|
Problema | Text | Scor | 90 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
#include <cstdio>
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
int medie=0,nrc=0,lg=0;
char c;
for(;!feof(stdin);) {
scanf("%c",&c);
if(('a'<=c && 'z'>=c) || ('A'<=c && 'Z'>=c)) ++medie,++lg;
else if( ' '==c && lg) ++nrc,lg=0;
else if(lg) lg=0,++nrc;
}
medie/=nrc;
printf("%d\n",medie);
return 0;
}