POJ3299 Humidex
来源:互联网 发布:兰大网络教育平台登录 编辑:程序博客网 时间:2024/06/08 01:20
题目大意:已知三个变量间的关系,给出两个变量,求第三个变量。
解题思想:输入方式两层循环,外层为while。
标记所求变量,选择合适公式。
#include <iostream>#include <cmath>#include <cstring>using namespace std; double h,t,d; bool bH,bT,bD;char strOpt[10]; int main(){while(scanf("%s",strOpt),strcmp(strOpt,"E")){double val; scanf("%lf",&val); if(strOpt[0]=='T'){t=val;bT=true;}else if(strOpt[0]=='D'){d=val;bD=true;}else{h=val;bH=true;} scanf("%s%lf",strOpt,&val); if(strOpt[0]=='T'){t=val;bT=true;}else if(strOpt[0]=='D'){d=val;bD=true;}else{h=val;bH=true;}if(!bH){double th,te; te=6.11*exp(5417.7530*((1/273.16)-(1/(d+273.16))));th=0.5555*(te-10.0);h=t+th;}else if(!bT){double th,te; te=6.11*exp(5417.7530*((1/273.16)-(1/(d+273.16))));th=0.5555*(te-10.0);t=h-th;}else{double th,te; th=h-t;te=th/0.5555+10.0;d=-1/(log(te/6.11)/5417.7530-1/273.16)-273.16;}printf("T %.1f D %.1f H %.1f\n",t,d,h);bH=bT=bD=false; } return 0; }
while(,strpot!='E') 不懂用字符的条件判断语句错在哪里。
0 0
- poj3299 Humidex
- POJ3299 Humidex
- POJ3299-Humidex
- poj3299 Humidex
- [POJ3299]Humidex
- POJ3299-Humidex
- POJ3299 Humidex
- POJ3299 -- Humidex
- Poj3299 Humidex java 分析
- poj3299 Humidex(water)
- poj3299 Humidex 细心=_=
- POJ3299
- poj3299
- poj3299
- poj3299
- poj3299
- poj3299
- poj3299
- 人工智能时代的降临
- 洛谷 P1280 尼克的任务
- SQL注入原理--手工联合查询注入技术
- The Child and Set
- mysql-5.7.17免安装版环境搭建
- POJ3299 Humidex
- Elasticsearch学习笔记(六)Elasticsearch分布式集群值helloWord
- B. Unary
- 无题。
- 微信小程序带参传递的界面跳转的两种方式
- Think PHP 学习笔记 6-7.CURD演示
- 1022. D进制的A+B (20)
- 数据结构与算法之排序
- 洛谷 P1020 导弹拦截