zoukankan      html  css  js  c++  java
  • poj 3299 Humidex

    题目链接:http://poj.org/problem?id=3299

            挺扯蛋的一题,本来想刷点水题,结果让这题的题目给虐了...抽空得好好补补英语了。主要是公式的推导

    代码:

    #include<iostream>
    #include
    <cstdio>
    #include
    <math.h>
    using namespace std;

    float e = 2.718281828 ;

    float fun1(float h, float d){
        
    return h-(0.5555*((6.11*pow(e,5417.7530*(1/273.16-1/(d+273.16))))-10.0)) ;
    }

    float fun2(float t,float d){
        
    return t+(0.5555*((6.11*pow(e,5417.7530*(1/273.16-1/(d+273.16))))-10.0)) ;
    }

    float fun3(float t,float h){
        
    return 1/(1/273.16-log(((h-t)/0.5555+10.0)/6.11)/5417.7530)-273.16 ;
    }

    int main(){
        
    char L[100] ;
        
    char a1, a2 ;
        
    float t1, t2 ;
        
    while(true){
            cin 
    >> a1 ;
            
    if(a1=='E')
                
    break ;
            cin 
    >> t1 >> a2 >> t2 ;
            
    if(a1=='D'&&a2=='H')
                printf(
    "T %.1f D %.1f H %.1f\n",fun1(t2,t1),t1,t2) ;
            
    else if(a1=='H'&&a2=='D')
               printf(
    "T %.1f D %.1f H %.1f\n",fun1(t1,t2),t2,t1) ;
            
    else if(a1=='T'&&a2=='D')
                printf(
    "T %.1f D %.1f H %.1f\n",t1,t2,fun2(t1,t2)) ;
            
    else if(a1=='D'&&a2=='T')
                printf(
    "T %.1f D %.1f H %.1f\n",t2,t1,fun2(t2,t1)) ;
            
    else if(a1=='T'&&a2=='H')
                printf(
    "T %.1f D %.1f H %.1f\n",t1,fun3(t1,t2),t2);
            
    else if(a1=='H'&&a2=='T')
                printf(
    "T %.1f D %.1f H %.1f\n",t2,fun3(t2,t1),t1) ;

        }
    }
  • 相关阅读:
    移动端适配方案总结
    排序算法
    使用onchange依赖监控文件修改失效
    实现一个可拖拽的div
    在vue中实现两个输入框内容的同步及转换
    简易loading动画的制作
    了解MVC
    Spring Boot使用模板引擎总结
    在配置好log4j后信息log还是在Console中输出
    运行时报java.sql.SQLException: No suitable driver的几种解决办法
  • 原文地址:https://www.cnblogs.com/xiaolongchase/p/2164322.html
Copyright © 2011-2022 走看看