Cod sursa(job #314908)

Utilizator bacerandreiBacer Andrei bacerandrei Data 13 mai 2009 16:46:03
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.46 kb
#include <stdio.h>

char ch;
int k, len, cuv;



int main()
{
  freopen("text.in" , "r" , stdin);
  freopen("text.out" , "w" , stdout);
   while(scanf("%c" , &ch) != EOF)
    {
      if((int(ch) >= 65 && int(ch) <=90) || (int(ch) >= 97 && int(ch) <= 122))
       {
	 len++;
	   if(k == 0)
	    {
	      k = 1;
	      cuv++;
	    }
       }
      else
	k = 0;
    }
   printf("%d" , len/cuv);
  fclose(stdin);
  fclose(stdout);
 return 0;
}