Cod sursa(job #41410)

Utilizator n_lichkingSentes Norbert n_lichking Data 28 martie 2007 11:36:35
Problema Text Scor 90
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.48 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;
  char d;
  nrl=nrc=0;
  f.get(d);
  while(!f.eof())
  {sw=1;
  c=d;
	if(isalpha(c))
    nrl++;
  f.get(d);
  if(isalpha(c)&&!isalpha(d))
    nrc++;     }

  f.close();
 if(!sw)
  nrl=nrc=1;
 fprintf(g,"%ld",((nrl)/nrc));
}

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

}