码迷,mamicode.com
首页 > 其他好文 > 详细

POJ - 3299 Humidex

时间:2017-03-05 00:37:51      阅读:205      评论:0      收藏:0      [点我收藏+]

标签:algorithm   algo   输出   cstring   abs   turn   ons   list   ide   

题意:已知两数,根据公式求第三个数。

分析:

1、.lfG++编译不过的C++可能编译过。

2、输出.lf改成.f后G++可编译过。

#pragma comment(linker, "/STACK:102400000, 102400000")
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cctype>
#include<iomanip>
#include<cmath>
#include<iostream>
#include<sstream>
#include<iterator>
#include<algorithm>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<deque>
#include<queue>
#include<list>
#define Min(a, b) ((a < b) ? a : b)
#define Max(a, b) ((a < b) ? b : a)
const double eps = 1e-8;
inline int dcmp(double a, double b){
    if(fabs(a - b) < eps) return 0;
    return a > b ? 1 : -1;
}
typedef long long LL;
typedef unsigned long long ULL;
const int INT_INF = 0x3f3f3f3f;
const int INT_M_INF = 0x7f7f7f7f;
const LL LL_INF = 0x3f3f3f3f3f3f3f3f;
const LL LL_M_INF = 0x7f7f7f7f7f7f7f7f;
const int dr[] = {0, 0, -1, 1, -1, -1, 1, 1};
const int dc[] = {-1, 1, 0, 0, -1, 1, -1, 1};
const int MOD = 1e9 + 7;
const double pi = acos(-1.0);
const int MAXN = 10000 + 10;
const int MAXT = 10000 + 10;
using namespace std;
int main()
{
    char a;
    while(1){
        double T = 200.0, D = 200.0, H = 200.0;
        for(int i = 0; i < 2; ++i){
            cin >> a;
            if(a == ‘E‘) return 0;
            if(a == ‘T‘){
                cin >> T;
            }
            else if(a == ‘D‘){
                cin >> D;
            }
            else if(a == ‘H‘){
                cin >> H;
            }
        }
        if(H == 200.0){
            H = T + 0.5555 * (6.11 * exp(5417.7530 * (1 / 273.16 - 1 / (D + 273.16))) - 10.0);
        }
        else if(T == 200.0){
            T = H - 0.5555 * (6.11 * exp(5417.7530 * (1 / 273.16 - 1 / (D + 273.16))) - 10.0);
        }
        else if(D == 200.0){
            D = 1 / (1 / 273.16 - log(((H - T) / 0.5555 + 10.0) / 6.11) / 5417.7530) - 273.16;
        }
        printf("T %.1f D %.1f H %.1f\n", T, D, H);
    }
    return 0;
}

 

POJ - 3299 Humidex

标签:algorithm   algo   输出   cstring   abs   turn   ons   list   ide   

原文地址:http://www.cnblogs.com/tyty-Somnuspoppy/p/6503230.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!