Cod sursa(job #37258)

Utilizator razvi9Jurca Razvan razvi9 Data 24 martie 2007 19:01:54
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;}