Cod sursa(job #41916)

Utilizator rokadaIacob Andrei Vasile rokada Data 28 martie 2007 18:16:06
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.43 kb
#include<fstream.h>
#include<math.h>
ifstream f("text.in");
ofstream g("text.out");
long int i,nrc,nrl,n;
char s[10000000],*p,sep[]=" [email protected]#$%^&*()_+|-=[]{};':,./<>?";
int main()
{

   f.getline(s,10000000);
   n=strlen(s);
   for(i=0;i<n;i++)
   	if((s[i]>='A'&&s[i]<='Z')||(s[i]>='a'&&s[i]<='z'))
      	nrl++;
   p=strtok(s,sep);
   while(p)
   {
   nrc++;
   p=strtok(NULL,sep);
   }
   g<<floor(nrl/nrc);
return 0;
}