Cod sursa(job #168229)
Utilizator | Data | 30 martie 2008 21:42:51 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.5 kb |
#include <cstdio>
char ch;
int n,nr=0,sw=0;
int main(){
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
while (!feof(stdin)) {scanf("%c",&ch);
if (('a'<=ch && ch<='z')||('A'<=ch && 'Z'>=ch))
{n++;
if (!sw) nr++;
sw=1;}
else sw=0;
}
printf("%d",n/nr);
return 0;
}