Page 2 of 2

11241,Runtime erroe ples help.

Posted: Sun Mar 16, 2008 10:30 pm
by turcse143
whats the error creates thats why i got RTE
PLES HELP

11241,Runtime error ples help.

Posted: Sun Mar 16, 2008 10:42 pm
by turcse143
here is my sample code. i don't know whats my problem i got RTE.
PLES check it

Code: Select all

#include<stdio.h>
#include<math.h>
#include<string.h>

char str[3];
double h,t,d,humidex,e;
char ch;
double i,f,c;
main()
{
	
	freopen("11241.in","rt",stdin);
	while(scanf("%s",str)==1)
	{
		if(strcmp(str,"E")==0)
			break;
		scanf("%lf %c %lf",&t,&ch,&d);
		if(strcmp(str,"T")==0&&ch=='D')
		{
			e =(double )6.11 * exp (5417.7530 * ((1/273.16) - (1/(d+273.16)))); 
			h =(double ) (0.5555)*(e-10.0);
			humidex = (double )t+h;
			printf("%s %.1lf %c %.1lf H %.1lf\n",str,t,ch,d,humidex);
		}
		else if(strcmp(str,"D")==0&&ch=='T')
		{
			e =(double ) 6.11 * exp (5417.7530 * ((1/273.16) - (1/(t+273.16)))); 
			h =(double ) (0.5555)*(e-10.0);
			humidex = (double )d+h;
			printf("%c %.1lf %s %.1lf H %.1lf\n",ch,d,str,t,humidex);
		}
		else if(strcmp(str,"H")==0&&ch=='D')
		{
			e = (double )6.11 * exp (5417.7530 * ((1/273.16) - (1/(d+273.16)))) ;
			h = (double )0.5555*(e-10.0);
			humidex = (double )t-h;
			printf("T %.1lf %c %.1lf %s %.1lf\n",humidex,ch,d,str,t);
		}
		else if(strcmp(str,"D")==0&&ch=='H')
		{
			e = (double )6.11 * exp (5417.7530 * ((1/273.16) - (1/(t+273.16)))); 
			h = (double )0.5555*(e-10.0);
			humidex =(double ) d-h;
			printf("T %.1lf %c %.1lf %s %.1lf\n",humidex,str,t,ch,d);
		}
		else if(strcmp(str,"T")==0&&ch=='H')
		{
		
			h=(double )d-t;
			e=(double )(h/0.5555)+10.0;
			c=(double )log(e/6.11);
			i=(double )c/5417.7530;
			f=(double )(1/273.16)-i;
			humidex=(double )(1/f)-273.16;
			printf("%s %.1lf D %.1lf %c %.1lf\n",str,t,humidex,ch,d);
		}
		else if(strcmp(str,"H")==0&&ch=='T')
		{
			h=(double )t-d;
			e=(double )(h/0.5555)+10.0;
			c=(double )log(e/6.11);
			i=(double )c/5417.7530;
			f=(double )(1/273.16)-i;
			humidex=(double )(1/f)-273.16;
			printf("%c %.1lf D %.1lf %s %.1lf\n",ch,d,humidex,str,t);
		}
	}
}


Re: 11241,Runtime error ples help.

Posted: Wed Aug 12, 2009 2:24 pm
by saiful_sust
HI.........
PLZ help me
I got WA........... :oops: :oops: :oops:

Code: Select all

cut after acc........