11241 - Humidex

Moderator: Board moderators

turcse143
Learning poster
Posts: 81
Joined: Wed May 09, 2007 9:59 pm

11241,Runtime erroe ples help.

whats the error creates thats why i got RTE
PLES HELP
Last edited by turcse143 on Mon Mar 17, 2008 10:33 pm, edited 1 time in total.
''I want to be most laziest person in the world''

turcse143
Learning poster
Posts: 81
Joined: Wed May 09, 2007 9:59 pm

11241,Runtime error ples help.

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);
}
}
}

``````
''I want to be most laziest person in the world''

saiful_sust
Learning poster
Posts: 97
Joined: Fri Aug 22, 2008 10:18 pm
Location: CSE.SUST.SYLHET

Re: 11241,Runtime error ples help.

HI.........
PLZ help me
I got WA...........

Code: Select all

``````cut after acc........
``````