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;
}
#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;
}
相关文章推荐
- poj 3299 Humidex
- poj 3299 Humidex
- POJ 3299 Humidex(简单的问题)
- POJ 3299 Humidex
- poj 3299 Humidex
- poj-3299 Humidex 水题,推公式
- POJ 3299 Humidex
- POJ 3299 Humidex(水~)
- POJ3299-Humidex
- POJ-3299 Humidex-湿度温度露点
- POJ - 3299 Humidex
- POJ 3299 Humidex
- POJ 3299 - Humidex
- POJ 3299.Humidex
- POJ 3299 Humidex
- POJ 3299 Humidex
- POJ 3299 Humidex
- Poj 3299 Humidex
- POJ 3299 Humidex 难度:0
- Poj 3299 Humidex