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

#include <iostream>
#include <iomanip>
using namespace std;
double exp(double x){
double ans=1;
double td=1;
for(int i=1;i<120;i++){
td=td*x/i;
ans+=td;
}
return ans;
}
const double ine= 2.718281828 ;
double ln(double x){
double ans=0;
while(x<-1||x>1){
ans++;
x=(x+1)/ine-1;
}
double td=-1;
for(int i=1;i<120;i++){
td*=-x;
ans+=td/(double)i;
}
return ans;
}
double t,d,h,temp;
int flag;
int main(){
ios::sync_with_stdio(false);
char st[9];
while(cin>>st){
flag=0;
if(st[0]=='E'){
break;
}
cin>>temp;
if(st[0]=='T'){
flag+=1;
t=temp;
}
else if(st[0]=='D'){
flag+=2;
d=temp;
}
else if(st[0]=='H'){
flag+=3;
h=temp;
}
cin>>st;
cin>>temp;
if(st[0]=='T'){
flag+=1;
t=temp;
}
else if(st[0]=='D'){
flag+=2;
d=temp;
}
else if(st[0]=='H'){
flag+=3;
h=temp;
}
if(flag==3) h=t-5.555+0.555*6.11*exp(5417.7530* ((1/273.16) - (1/(d+273.16))));
else if(flag==4) {
double e=((h-t)/0.5555)+10.0; double td=ln((e/6.11)-1);
d=1.0/((1.0/273.16)-td/5417.7530)-273.16;
}
else t= h+ 5.555- 0.555*6.11*exp(5417.7530* ((1/273.16) - (1/(d+273.16))));
cout<<"T "<<setiosflags(ios::fixed)<<setprecision(1)<<t<<" D "<<d<<" H "<<h<<"\n";
}
return 0;
}

POJ 3299 Humidex 难度:0的更多相关文章

  1. POJ 3094 Quicksum 难度:0

    http://poj.org/problem?id=3094 #include<iostream> #include <string> using namespace std; ...

  2. poj 3299 Humidex

    直接套公式就可以,可我套公式第一遍都错了,英语差的孩子伤不起(┬_┬) #include <iostream> #include <cmath> #include <io ...

  3. POJ 3299 Humidex(简单的问题)

    [简要题意]:什么是温度,湿度--,之间的转换.. [分析]:式已被赋予. // 252k 0Ms /* 当中exp表示的是求e的x次幂 解法就直接依据题目中的公式解决就好!! */ #include ...

  4. POJ 3286 How many 0's?(几多0?)

    POJ 3286 How many 0's?(几多0?) Time Limit: 1000MS   Memory Limit: 65536K [Description] [题目描述] A Benedi ...

  5. POJ 1094 Sorting It All Out 拓扑排序 难度:0

    http://poj.org/problem?id=1094 #include <cstdio> #include <cstring> #include <vector& ...

  6. POJ 2240 && ZOJ 1082 Arbitrage 最短路,c++ stl pass g++ tle 难度:0

    http://poj.org/problem?id=2240 用log化乘法为加法找正圈 c++ 110ms,g++tle #include <string> #include <m ...

  7. POJ 1125 Stockbroker Grapevine 最短路 难度:0

    http://poj.org/problem?id=1125 #include <iostream> #include <cstring> using namespace st ...

  8. POJ 2253 Frogger 最短路 难度:0

    http://poj.org/problem?id=2253 #include <iostream> #include <queue> #include <cmath&g ...

  9. POJ 1062 昂贵的聘礼 最短路 难度:0

    http://poj.org/problem?id=1062 #include <iostream> #include <cstring> #include <queue ...

随机推荐

  1. bootstrap学习笔记<四>(table表格)

    表格 bootstrap为table表格定制多个常用样式:基本样式,隔行变色样式,带边框样式,荧光棒样式,紧凑样式,响应样式. ☑  .table:基础表格 ☑  .table-striped:斑马线 ...

  2. poj3565Ants(KM-几何与图论的结合)

    链接 可以看出蓝的之和一定比红的之和要大,也就是说符合条件的匹配一定是权值最小的,所以二分图的最佳完美匹配..KM #include <iostream> #include<cstd ...

  3. numpy库的常用知识

    为什么有numpy这个库呢?准安装的Python中用列表(list)保存一组值,可以用来当作数组使用,不过由于列表的元素可以是任何对象,因此列表中所保存的是对象的指针.这样为了保存一个简单的[1,2, ...

  4. ajax获取城市和相应的地区

    <!DOCTYPE html><html lang="zh-CN"><head> <meta charset="UTF-8&qu ...

  5. Scroller 实现的弹性回弹的LinearLayout

    由于公司业务发展,多app需求很少,被调到java后台开发接口三个月了,还要我继续做 java,最近有点想换工作,不得不重新看看基础知识了. 晚上看到了滑动的实现方式,平滑滑package com.e ...

  6. 5.4.2 使用配置启动firefox

    1.使用firefox的本地配置加载浏览器 使用本地配置加载浏览器,代码如下. 这样运行后,可以看到firebug等插件都已启动. 练习:假设做性能测试时,需要获取某个状况下的页面网络运行参数.要求完 ...

  7. js中event.target和event.srcElement的区别

    看了很多资料绝对结果就是 firefox 下的 event.target = IE 下的 event.srcElement jquery中的event.target属性的作用是获取到出发事件的元素.j ...

  8. jquery学习笔记1

    (1) jQuery的Id选择器: $("#btnShow") (2) 事件绑定函数 bind() $("#btnAdd").bind("click& ...

  9. hdu----(5053)the Sum of Cube(签到题,水体)

    the Sum of Cube Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)T ...

  10. 自动发牌(C#版)

    利用数组实现发牌过程 一副牌去掉大小王,还剩52张.一共东.南.西.北四家,每家随机发13张牌. 提示: 东.南.西.北四家用一维数组表示 每家的牌采用一维数组表示(13张)  花色:enum Sui ...