题目链接: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. Win7x64_chromeX86_相关路径

    1. C:\Users\33\AppData\Local\Google 里面有2个文件夹:“Chrome”.“CrashReports” 2. C:\Program Files (x86)\Googl ...

  2. OC面向对象及继承

    1. 面向对象它通过给程序中加入扩展语句,把函数“封装”进编程所必需的“对象”中.面向对象的编程语言使得复杂的工作条理清晰.编写容易.说它是一场革命,不是对对象本身而言,而是对它们处理工作的能力而言. ...

  3. [转载] linux 程序运行过程中替换文件

    今天被朋友问及“Linux下可以替换运行中的程序么?”,以前依稀记得Linux下是可以的(而Windows就不让),于是随口答道“OK”.结果朋友发来一个执行结果:(test正在运行中)# cp te ...

  4. [转载] 一致性问题和Raft一致性算法

    原文: http://daizuozhuo.github.io/consensus-algorithm/ raft 协议确实比 paxos 协议好懂太多了. 一致性问题 一致性算法是用来解决一致性问题 ...

  5. poj2074Line of Sight(直线相交)

    链接 几何细节题. 对于每一个障碍物可以求出它在地产线上的覆盖区间,如下图. 紫色部分即为每个障碍物所覆盖掉的区间,求出所有的,扫描一遍即可. 几个需要注意的地方:直线可能与地产线没有交点,可视区间可 ...

  6. 【Todo】Python字符编码学习

    Python中经常出现字符编码问题,在这里统一整理吧. 参考这篇文章:http://www.cnblogs.com/huxi/archive/2010/12/05/1897271.html 另外这个人 ...

  7. iOS开发之 Xcode 一个工程 Project 添加多个 target

    http://www.360doc.com/content/14/1203/11/19119980_430056974.shtml# 根据项目需求,同一个工程有多个版本,每个版本只有细微的不同.所以, ...

  8. 转:Eric Lippert:阅读代码真的很难

    转自:http://blog.jobbole.com/438/ 相关文章 微软资深软件工程师:阅读代码真的很难(第2篇) 阅读优秀代码是提高开发人员修为的一种捷径 学会阅读源代码 如何阅读大型代码库? ...

  9. 20160815_Redis安装

    OS: CentOS6.4(x64) 参考网址: http://www.cnblogs.com/haoxinyue/p/3620648.html http://www.codeceo.com/arti ...

  10. table和div设置height:100%无效的完美解决方法

    刚接触网页排版的新手,常出现这种情况:设置table和div的高height="100%"无效,使用CSS来设置height:"100%"也无效,为什么会这样呢 ...