poj 3299
来源:互联网 发布:淘宝付款收不到验证码 编辑:程序博客网 时间:2024/05/18 12:04
这题纯水,但要注意格式化输出读入的细节和考虑问题要全面。原题有原数的用原数。
#include <iostream>#include <cmath>#include <stdio.h>using namespace std;const double e = 2.718281828;double td2h(double t,double d){ return t + (0.5555) * (6.11 * pow(e,5417.7530 * ((1/273.16) - (1/(d + 273.16)))) - 10.0);}double dh2t(double d,double h){ return h - (0.5555) * (6.11 * pow(e,5417.7530 * ((1/273.16) - (1/(d + 273.16)))) - 10.0);}double th2d(double t,double h){ return 273.16 / (1 - 273.16 * log((((h - t) / 0.5555 + 10.0) / 6.11)) /5417.7530) - 273.16;}int main(){ char c1,c2; double p1,p2; while(scanf("%c",&c1) && c1 != 'E') { scanf("%lf %c %lf",&p1,&c2,&p2); if(c1 == 'T' && c2 == 'D') printf("T %.1lf D %.1lf H %.1lf\n",p1,p2,td2h(p1,p2)); else if(c2 == 'T' && c1 == 'D') printf("T %.1lf D %.1lf H %.1lf\n",p2,p1,td2h(p2,p1)); else if(c1 == 'D' && c2 == 'H') printf("T %.1lf D %.1lf H %.1lf\n",dh2t(p1,p2),p1,p2); else if(c2 == 'D' && c1 == 'H') printf("T %.1lf D %.1lf H %.1lf\n",dh2t(p2,p1),p2,p1); else if(c1 == 'T' && c2 == 'H') printf("T %.1lf D %.1lf H %.1lf\n",p1,th2d(p1,p2),p2); else if(c2 == 'T' && c1 == 'H') printf("T %.1lf D %.1lf H %.1lf\n",p2,th2d(p2,p1),p1); } return 0;}
- poj 3299
- POJ 3299
- poj 3299
- POJ 3299
- poj 3299
- POJ 3299
- POJ 3299
- poj 3299
- POJ 3299
- poj 3299
- poj 3299
- poj 3299
- POJ 3299
- poj 3299
- POJ 3299
- POJ 3299
- POJ 3299
- poj 3299
- 如何成为一个编程高手
- 关于,函数调用是传值调用,初始化函数中重新分配内存,导致形参的值和实参的值不一致 问题分析
- Memcache - 分布式算法
- makefile详解 条件判断 二十
- Android 多线程之 Handler、Looper、Message 在基于 HTTP 系统中的应用
- poj 3299
- makefile详解 函数 字符串 文件名 二十一
- 对程序员的十条忠告&一些有趣的编程名言
- makefile详解 函数 foreach if call origin shell 控制make函数 二十二
- makefile详解 make 的运行 二十三
- 构建工具scons让一切变得简单
- 喜欢自己的一句话
- makefile详解 隐含规则 二十四
- uva 216 - Getting in Line