Cod sursa(job #88528)

Utilizator gabitzish1Gabriel Bitis gabitzish1 Data 2 octombrie 2007 20:29:10
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.48 kb
/*
100p
*/
#include<stdio.h>
#include<fstream.h>
#include<string.h>

int len, cuv, k;
char c;

void citire()
{
  int sol;
  freopen("text.in","r",stdin);
  scanf("%c",&c);
  while (!feof(stdin))
     {
	if (c>='a' && c<='z' || c>='A'&& c<='Z')
	  {
	     len++;
	     if (k==0)
		cuv++;
	     k=1;
	  }
	  else k=0;
	  scanf("%c",&c);
     }
  sol=len/cuv;
  freopen("text.out","w",stdout);
  printf("%d",sol);
}

int main()
{
  citire();
  return 0;
}