Cod sursa(job #42537)

Utilizator AlxCojocaru Alexandru Alx Data 29 martie 2007 11:58:07
Problema Text Scor 90
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.39 kb
#include <stdio.h>
using namespace std;
char c;
long nrc,nrcv;
int main()
{
 freopen("text.in","r",stdin);
 freopen("text.out","w",stdout);
 c=fgetc(stdin);
 int cuv=0;
 while (c!=EOF)
 {
  if ((c>='A'&&c<='Z')||(c>='a'&&c<='z'))
  {
   cuv=1;
   nrc++;
  }
  else
   if (cuv)
   {
	nrcv++;
	cuv=0;
   }
  c=NULL;
  c=fgetc(stdin);
 }
 printf("%ld\n",nrc/nrcv);
 return 0;
}