![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
/**//**************************************
Problem: POJ 3299 Humidex
Time: 0MS
Memory: 184K
Accepted Time: 2009-05-15 13:09:04
Tips:
**************************************/
#include <stdio.h>
#include <math.h>
double t,d,h;
double td2h()
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
{
return t+0.5555*(6.11*pow(2.718281828,5417.7530*((1/273.16)-(1/(d+273.16))))-10.0);
}
double dh2t()
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
{
return h-0.5555*(6.11*pow(2.718281828,5417.7530*((1/273.16)-(1/(d+273.16))))-10.0);
}
double th2d()
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
{
return 1/((1/273.16)-log(((h-t)/0.5555+10.0)/6.11)/5417.7530)-273.16;
}
int main()
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
{
char str[5];
int tf,df,hf;
double temp;
while(1)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
tf=df=hf=0;
scanf("%s",str);
if(str[0]=='E')break;
scanf("%lf",&temp);
if(str[0]=='T')tf=1,t=temp;
else if(str[0]=='D')df=1,d=temp;
else if(str[0]=='H')hf=1,h=temp;
scanf("%s%lf",str,&temp);
if(str[0]=='T')tf=1,t=temp;
else if(str[0]=='D')df=1,d=temp;
else if(str[0]=='H')hf=1,h=temp;
if(tf&&df)printf("T %.1lf D %.1lf H %.1lf\n",t,d,td2h());
else if(df&&hf)printf("T %.1lf D %.1lf H %.1lf\n",dh2t(),d,h);
else if(tf&&hf)printf("T %.1lf D %.1lf H %.1lf\n",t,th2d(),h);
}
return 0;
}
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
posted @
2009-05-16 11:57
主函数
阅读(
331)
评论()
编辑
收藏
举报