poj水题--ID3299
2012-10-18 15:14
288 查看
不贴题目了,描述的很复杂,其实这个题主要是考察简单的逻辑设计问题吧,看了其他人的答案,有的地方没看懂,还是用麻烦的if else解决的:
成功AC了。
#include<iostream> #include<iomanip> #include<math.h> using namespace std; int main() { char a; double t,d,h; while(cin>>a&&a!='E') { if(a=='T') { cin>>t>>a; if(a=='D') {cin>>d; h=t+0.5555*(6.11*exp(5417.7530*(1/273.16-1/(d+273.16)))-10); } else { cin>>h; d= 1/((1/273.16)-((log((((h-t)/0.5555)+10.0)/6.11))/5417.7530))-273.16; } } else if(a=='D') { cin>>d>>a; if(a=='T') {cin>>t; h=t+0.5555*(6.11*exp(5417.7530*(1/273.16-1/(d+273.16)))-10); } else { cin>>h; t=h-0.5555*(6.11*exp(5417.7530*(1/273.16-1/(d+273.16)))-10); } } else { cin>>h>>a; if(a=='D') { cin>>d; t=h-0.5555*(6.11*exp(5417.7530*(1/273.16-1/(d+273.16)))-10); } else { cin>>t; d= 1/((1/273.16)-((log((((h-t)/0.5555)+10.0)/6.11))/5417.7530))-273.16; } } cout.setf(ios::fixed); cout<<setprecision(1)<<"T "<<t<<" "<<"D "<<d<<" "<<"H "<<h<<endl; } }
成功AC了。
相关文章推荐
- POJ 3299 Humidex(水题)
- poj水题--ID3030
- POJ 3299 水题
- 一个poj水题--ID 2027
- poj-3299 Humidex 水题,推公式
- poj水题--ID3062
- POJ 3299:Humidex(水题)
- poj 1915 http://poj.org/problem?id=1915
- POJ1844 Sum【水题+数学题】
- POJ 2209 The King(我的水题之路——n次方之和)
- POJ 1316 Self Numbers (水题)
- POJ 2363 Blocks(我的水题之路——立方体体积和表面积,暴力)
- poj 2304/3032 水题(时钟转动/扑克排序)
- POJ 2562 Primary Arithmetic(我的水题之路——模拟加法进位)
- POJ 2840 Big Clock(我的水题之路——水,钟)
- poj1002 487-3279 ——水题
- POJ1003-Hangover(水题)
- POJ 1005 I Think I Need a Houseboat(水题)
- Poj1207 The 3n + 1 problem(水题(数据)+陷阱)
- POJ 2665 水题