分类:
2009-03-19 10:16:05
#include
#include
using namespace std;
double T, D, H, e, h;
int main()
{
//freopen("input.txt","r",stdin);
char c1,c2;
double num1, num2, num3;
while(EOF!=scanf("%c",&c1),c1!='E')
{
scanf("%lf %c %lf", &num1, &c2, &num2);
if(c1=='T'&&c2=='D')
{
e = 6.11 * exp (5417.7530 * ((1/273.16) - (1/(num2+273.16))));
h = (0.5555)* (e - 10.0);
num3 = num1 + h;
printf("T %.1lf D %.1lf H %.1lf\n",num1,num2,num3);
continue;
}
if(c1 == 'T' && c2 == 'H')
{
num3 = 1/((1/273.16)- log( ((num2 - num1) / 0.5555 + 10.0 )/6.11 ) /5417.7530 ) -273.16;
printf("T %.1lf D %.1lf H %.1lf\n",num1,num3,num2);
continue;
}
if(c1 == 'D' && c2 == 'H'){
e = 6.11 * exp(5417.7530 * ((1/273.16) - (1 / (num1+273.16) )));
h = (0.5555)* (e - 10.0);
num3 = num2 - h;
printf("T %.1lf D %.1lf H %.1lf\n",num3,num1,num2);
continue;
}
if(c1 == 'D' && c2 == 'T')
{
e = 6.11 * exp(5417.7530 * ((1/273.16) - (1 / (num1+273.16) )));
h = (0.5555)* (e - 10.0);
num3 = num2 + h;
printf("T %.1lf D %.1lf H %.1lf\n",num2,num1,num3);
continue;
}
if(c1 == 'H' && c2 == 'T'){
num3 = 1/((1/273.16)- log( ((num1 - num2) / 0.5555 + 10.0 )/6.11 ) /5417.7530 ) -273.16;
printf("T %.1lf D %.1lf H %.1lf\n",num2,num3,num1);
continue;
}
if(c1 == 'H' && c2 == 'D'){
e = 6.11 * exp(5417.7530 * ((1/273.16) - (1 / (num2+273.16) )));
h = (0.5555)* (e - 10.0);
num3 = num1 - h;
printf("T %.1lf D %.1lf H %.1lf\n",num3,num2,num1);
continue;
}
}
return 0;
}