#include <iostream>
#include <math.h>
#include <stdio.h>
using namespace std;
int main()
{
//freopen("out.txt","w",stdout);
char a,b;
double num1,num2;
double T,D,H;
double h,e;
scanf("%c",&a);
char temp;
while(a!='E'){
T=D=H=-9;
scanf("%lf %c %lf",&num1,&b,&num2);
temp=getchar();
if(a=='T') T=num1;
else if(a=='H') H=num1;
else if(a=='D') D=num1;
if(b=='T') T=num2;
else if(b=='H') H=num2;
else if(b=='D') D=num2;
if(T==-9){
e=6.11*exp(5417.7530*((1/273.16)-(1/(D+273.16))));
h=0.5555*(e-10.0);
T=H-h;
}
else if(H==-9){
e=6.11*exp(5417.7530*((1/273.16)-(1/(D+273.16))));
h=0.5555*(e-10.0);
H=T+h;
}
else if(D==-9){
D=1 /( (1/273.16) - ( log( (10+(H-T)/(0.5555))/6.11 ) / 5417.7530 ) ) - 273.16 ;
//d=1/((1/273.16)-((log((((h-t)/0.5555)+10.0)/6.11))/5417.7530))-273.16;
}
printf("T %.1lf D %.1lf H %.1lf\n",T,D,H);
scanf("%c",&a);
}
}
POJ3299 (借助改变的初始变量,得知进入哪种情况)
最新推荐文章于 2020-10-01 08:16:14 发布