您的位置:首页 > 其它

POJ 3299 Humidex 杂题

2011-09-10 01:37 357 查看
题意:略。按公式便好。
#include <cmath>
#include <iomanip>
#include <iostream>
using namespace std;

int main()
{
double one, two;
char first, second;
cout << setprecision ( 1 ) << fixed;

while ( cin >> first && first != 'E' )
{
cin >> one >> second >> two;
if ( first == 'T' || second == 'T' )
{
if ( first != 'T' )
{
swap(first,second);
swap(one,two);
}
if ( second == 'D' )
{
double h = ( 0.5555 ) * ( 6.11 * exp( 5417.7530 * ( 1 / 273.16 - 1 / ( two + 273.16 ) ) ) - 10.0 );
cout << "T " << one << " D " << two << " H " << one + h << endl;
}
else
{
double d = -273.16 - 1 / (log ( ((two - one )/ 0.5555 + 10.0) / 6.11 ) / 5417.7530 - 1 / 273.16);
cout << "T " << one << " D " << d << " H " << two << endl;
}
}
else
{
if ( first != 'H' )
{
swap(first,second);
swap(one,two);
}
double t = one - ( 0.5555 ) * ( 6.11 * exp( 5417.7530 * ( 1 / 273.16 - 1 / ( two + 273.16 ) ) ) - 10.0 );
cout << "T " << t << " D " << two << " H " << one << endl;
}
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: