Cod sursa(job #128505)

Utilizator gabor_oliviu1991gaboru corupt gabor_oliviu1991 Data 27 ianuarie 2008 12:53:58
Problema Text Scor 70
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.6 kb
#include<fstream.h>
#include<string.h>
int main(){
char a[65535],*p,sep[]="~!@#$%^&*()_+=-`1234567890][{}\';:,./?><|""";
int s=0,i,y=0;
ifstream f("text.in");
ofstream g("text.out");
while(!f.eof())
    {f>>a;
     p=strtok(a,sep);
     while(p)
	{ y++;
	  s+=strlen(p);
	  p=strtok(NULL,sep);
	   }
     }






/*while(!f.eof())
    {f>>a;
     for(i=0;i<strlen(a);i++)
	{k=0;
	if((a[i]>='a'&&a[i]<='z')||(a[i]>='A'&&a[i]<='Z'))
		{
		 while((a[i]>='a'&&a[i]<='z')||(a[i]>='A'&&a[i]<='Z'))
		       {k++;i++;}
		  y++;
		}
	x+=k;
	k=0;
	}
    }*/
g<<(int)s/y;
return 0;
}