公式题中已经给出,直接求解即可。

 #include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cctype>
#include <algorithm>
#include <numeric>
#include <sstream>
#include <map>
#include <iomanip>
using namespace std; map<char, double> data; int main () {
ios :: sync_with_stdio (false);
char C1, C2;
double X1, X2;
while (cin >> C1) {
if (C1 == 'E') break;
cin >> X1 >> C2 >> X2;
data[C1] = X1; data[C2] = X2;
if ( (C1 == 'T' && C2 == 'H') || (C1 == 'H' && C2 == 'T') ) {
double h = data['H'] - data['T'];
double e = h / 0.5555 + 10.0;
double ln_ = log (e / 6.11);
data['D'] = 1.0 / (1.0 / 273.16 - ln_ / 5417.7536) - 273.16;
}
else { double e = 6.11 * exp (5417.7530 * (1.0 / 273.16 - (1.0 / (data['D'] + 273.16))));
//cout << "e = " << e << endl;
double h = (0.5555) * (e - 10.0);
//cout << "h = " << h << endl;
if ((C1 == 'T' && C2 == 'D' ) || (C1 == 'D' && C2 == 'T')) {
//cout << "T D -> H" << endl;
data['H'] = data['T'] + h;
}
if ((C1 == 'H' && C2 == 'D' ) || (C1 == 'D' && C2 == 'H')) {
//cout << "H D -> T" << endl;
data['T'] = data['H'] - h;
}
}
printf ("T %.1f D %.1f H %.1f\n", data['T'], data['D'], data['H']);
}
return ;
}

【POJ3299】Humidex(简单的数学推导)的更多相关文章

  1. 关于不同进制数之间转换的数学推导【Written By KillerLegend】

    关于不同进制数之间转换的数学推导 涉及范围:正整数范围内二进制(Binary),八进制(Octonary),十进制(Decimal),十六进制(hexadecimal)之间的转换 数的进制有多种,比如 ...

  2. 『sumdiv 数学推导 分治』

    sumdiv(POJ 1845) Description 给定两个自然数A和B,S为A^B的所有正整数约数和,编程输出S mod 9901的结果. Input Format 只有一行,两个用空格隔开的 ...

  3. 借One-Class-SVM回顾SMO在SVM中的数学推导--记录毕业论文5

    上篇记录了一些决策树算法,这篇是借OC-SVM填回SMO在SVM中的数学推导这个坑. 参考文献: http://research.microsoft.com/pubs/69644/tr-98-14.p ...

  4. css3 calc():css简单的数学运算-加减乘除

    css3 calc():css简单的数学运算–加减乘除 多好的东西啊,不用js,一个css就解决了. .box{ border:1px solid #ddd; width:calc(100% - 10 ...

  5. UVA - 10014 - Simple calculations (经典的数学推导题!!)

    UVA - 10014 Simple calculations Time Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & ...

  6. LDA-线性判别分析(二)Two-classes 情形的数学推导

    本来是要调研 Latent Dirichlet Allocation 的那个 LDA 的, 没想到查到很多关于 Linear Discriminant Analysis 这个 LDA 的资料.初步看了 ...

  7. leetcode 343. Integer Break(dp或数学推导)

    Given a positive integer n, break it into the sum of at least two positive integers and maximize the ...

  8. [hdu5307] He is Flying [FFT+数学推导]

    题面 传送门 思路 看到这道题,我的第一想法是前缀和瞎搞,说不定能$O\left(n\right)$? 事实证明我的确是瞎扯...... 题目中的提示 这道题的数据中告诉了我们: $sum\left( ...

  9. ZOJ3329(数学推导+期望递推)

    要点: 1.期望的套路,要求n以上的期望,则设dp[i]为i分距离终点的期望步数,则终点dp值为0,答案是dp[0]. 2.此题主要在于数学推导,一方面是要写出dp[i] = 什么,虽然一大串但是思维 ...

随机推荐

  1. PHP中文汉字验证码

    hb.ttf换成随便你自己下载的ttf Header("Content-type: image/PNG"); $str="的一是在了不和有大这主中人上为们地个用工时要动国 ...

  2. C++——try、throw、catch实例学习程序

    #include<iostream> #include<stdexcept> //exception/stdexcept/new/type_info头文件里都有定义的标准异常类 ...

  3. [RxJS] Getting Input Text with Map

    By default, Inputs will push input events into the stream. This lesson shows you how to use map to c ...

  4. Hacker(18)----了解Windows系统漏洞

    一.WinXP中的漏洞 在WinXP中,常见的漏洞主要有UPNP服务漏洞.帮助与支持中心漏洞.压缩文件夹漏洞.服务拒绝漏洞.RDP漏洞以及热键漏洞. 1.UPNP服务漏洞 漏洞描述:UPNP(Univ ...

  5. Oracle用户解锁的三种办法及默认的用户与密码

    ORA-28000: the account is locked-的解决办法 2009-11-11 18:51 ORA-28000: the account is locked 第1步:使用PL/SQ ...

  6. Action重定向总结

    [HttpPost] public ActionResult StudentList( string StudName, string studName, DateTime BirthDay, For ...

  7. RAID磁盘阵列原理

    磁盘阵列(Redundant Arrays of independent Disks,RAID),有“价格便宜具有冗余能力的磁盘阵列”之意.原理是利用数组方式来作磁盘组,配合数据分散排列的设计,提升数 ...

  8. UC浏览器 分享到朋友圈和微信好友

    用手机UC浏览器访问新浪微博,会注意到有这样的两个分享按钮: 在手机端浏览器里,点击分享按钮,就可以启动微信客户端并分享到微信.研究了下其源代码,存在这样的一个js:http://mjs.sinaim ...

  9. keil中查看内存数据

    1.工具栏中 view->Memory Windows 然后  c:0 表示读取0地址开始的代码区数据  d:0 表示读取0地址开始的数据区数据  x:0表示读取0地址开始的外部数据区

  10. C#检测串口被拔掉等一些触发事件合集

    // //设备异常重载 // protected override void WndProc(ref Message m) { if (m.Msg == 0x0219) {//设备被拔出 if (m. ...