Cod sursa(job #38014)
Utilizator | Data | 25 martie 2007 14:25:29 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.3 kb |
#include<stdio.h>
#include<ctype.h>
char c;
int ok,nr,nc;
int main()
{freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
while(!feof(stdin))
{scanf("%c",&c);
if(isalpha(c)) {nr++;ok=1;}
else {nc=nc+ok;ok=0;} }
if(ok) nc++;
printf("%d",nr/nc);
fclose(stdout);
return 0;}