Cod sursa(job #41464)

Utilizator n_lichkingSentes Norbert n_lichking Data 28 martie 2007 11:58:39
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.46 kb

#include<stdio.h>
#include<ctype.h>
#include<string.h>
#include<fstream.h>
char c;
FILE *g=fopen("text.out","w");


void cit()
{long n,i,nrc,nrl;
 ifstream f("text.in");
  int sw=0;
  nrl=nrc=0;
  
  while(!f.eof())
  {   f.get(c);
	if(isalpha(c))
       {nrl++;
       if(!sw)
        {nrc++;
         sw=1;}}
       else sw=0;
  }
  f.close();
 fprintf(g,"%ld",((nrl)/nrc));
}

int main()
{
  cit();
  fcloseall();
return 0;

}