Cod sursa(job #37259)
Utilizator | Data | 24 martie 2007 19:03:43 | |
---|---|---|---|
Problema | Text | Scor | 90 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.28 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;} }
printf("%d",nr/nc);
fclose(stdout);
return 0;}