POJ 3299 Humidex 模拟数学题

POJ-3299解题 POJ-3299解题 C++源代码 Description Adapted from Wikipedia, the free encyclopedia The humidex is a measurement used by Canadian meteorologists to reflect the combined effect of heat and humidity. It differs from the heat index used in the United States in using dew point rather than relative humidity. 立即下载
Humidex
Time Limit: 1000MS Memory Limit: 65536K
Total Submissions: 15596 Accepted: 5696

Description

Adapted from Wikipedia, the free encyclopedia

The humidex is a measurement used by Canadian meteorologists to reflect the combined effect of heat and humidity. It differs from the heat index used in the United States in using dew point rather than relative humidity.

When the temperature is 30°C (86°F) and the dew point is 15°C (59°F), the humidex is 34 (note that humidex is a dimensionless number, but that the number indicates an approximate temperature in C). If the temperature remains 30°C and the dew point rises to 25°C (77°F), the humidex rises to 42.3.

The humidex tends to be higher than the U.S. heat index at equal temperature and relative humidity.

The current formula for determining the humidex was developed by J.M. Masterton and F.A. Richardson of Canada's Atmospheric Environment Service in 1979.

According to the Meteorological Service of Canada, a humidex of at least 40 causes "great discomfort" and above 45 is "dangerous." When the humidex hits 54, heat stroke is imminent.

The record humidex in Canada occurred on June 20, 1953, when Windsor, Ontario hit 52.1. (The residents of Windsor would not have known this at the time, since the humidex had yet to be invented.) More recently, the humidex reached 50 on July 14, 1995 in both Windsor and Toronto.

The humidex formula is as follows:

humidex = temperature + h
h = (0.5555)× (e - 10.0)
e = 6.11 × exp [5417.7530 × ((1/273.16) - (1/(dewpoint+273.16)))]
where  exp(x) is 2.718281828 raised to the exponent  x.

While humidex is just a number, radio announcers often announce it as if it were the temperature, e.g. "It's 47 degrees out there ... [pause] .. with the humidex,". Sometimes weather reports give the temperature and dewpoint, or the temperature and humidex, but rarely do they report all three measurements. Write a program that, given any two of the measurements, will calculate the third.

You may assume that for all inputs, the temperature, dewpoint, and humidex are all between -100°C and 100°C.

Input

Input will consist of a number of lines. Each line except the last will consist of four items separated by spaces: a letter, a number, a second letter, and a second number. Each letter specifies the meaning of the number that follows it, and will be either T, indicating temperature, D, indicating dewpoint, or H, indicating humidex. The last line of input will consist of the single letter E.

Output

For each line of input except the last, produce one line of output. Each line of output should have the form:

T number D number H number
where the three numbers are replaced with the temperature, dewpoint, and humidex. Each value should be expressed rounded to the nearest tenth of a degree, with exactly one digit after the decimal point. All temperatures are in degrees celsius.

Sample Input

T 30 D 15
T 30.0 D 25.0
E

Sample Output

T 30.0 D 15.0 H 34.0
T 30.0 D 25.0 H 42.3

Source


感谢 @丁钦颖 提供题目

题意:已知TDH三个变量由任意两个推第三个的公式(自己手算)。给任意两个变量(不一定是T和D),让你求第三个,并把三个变量依次输出

#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main()
{
	double t,d,h,a,b;
	int i,j,k,flag;
	char c1,c2;
	while(cin>>c1 && c1 !='E')
	{
		i=j=k=1;
		cin>>a>>c2>>b;
		if (c1=='T'){ i=0; t=a; }
		if (c1=='D'){ j=0; d=a; }
		if (c1=='H'){ k=0; h=a; }
		if (c2=='T'){ i=0; t=b; }
		if (c2=='D'){ j=0; d=b; }
		if (c2=='H'){ k=0; h=b; }
		if (i) t=h-0.5555*(6.11*exp(5417.7530*(1/273.16-1/(d+273.16)))-10.0);
		if (j) d=1/(1/273.16-log(((h-t)/0.5555+10)/6.11)/5417.753)-273.16;
		if (k) h=t+0.5555*(6.11*exp(5417.7530*(1/273.16-1/(d+273.16)))-10.0);
		printf("T %.1f D %.1f H %.1f\n",t,d,h);
	}
	return 0;
}

kdwycz的网站:  http://kdwycz.com/

kdwyz的刷题空间:http://blog.csdn.net/kdwycz


【01、Go与VSCode的安装】 小白学Go语言 阅读详情

相关推荐

ERA5 hourly data批量下载与cdo处理(一)

本篇文章主要介绍了ERA数据的批量下载

qq_40511689的博客 3879

poj 3299 Humidex

Humidex Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 9883 Accepted: 3755 Description Adapted from Wikipedia, the free encyclopedia The humidex is a mea...

weixin_30955341的博客 305

别再混淆了!一张图看懂SAP特殊采购类30/40/70/80的区别与选型指南

本文深度解析SAP特殊采购类30/40/70/80的核心逻辑与业务影响,通过对比框架和真实案例帮助用户掌握其适用边界。重点介绍委外加工(类型30)、工厂间转移(类型40/70)及计划与执行分离(类型80)的配置要点与常见问题,提供选型决策树和实施检查清单,助力企业优化供应链管理。

weixin_26938645的博客 462

poj-3299 Humidex 水题,推公式

poj-3299 Humidex

Nervending的 591

TCGA之GDC-client工具下载安装与使用

文章主要是对GDC-client工具下载TCGA数据库数据整个过程的一个记录 1.下载GDC-client工具 GDC-client工具网址:GDC Data Transfer Tool | NCI Genomic Data Commons (cancer.gov) 我这里下的是上图中红圈中的版本, 2.解压安装 从网上了解的是不能解压到带中文的路径里,解压后是一个.exe文件,为了能直接在cmd命令行下使用,将其加入系统环境: 点击新建之后,输入将文件解压到的路径,然后...

better_strong的博客 1万+

智算中心建设全流程指南:从规划到落地

智算中心的建设是一个复杂而系统的过程,涉及选址、立项、办理相关手续、设计、土建、机电安装、调试、验收等多个环节。每个环节都需要充分考虑各种因素,并注意相关的事项,以确保智算中心的顺利建设和高效运行

数据中心全生命周期价值管理 3420

POJ3299 Humidex 简单二分

求humidex和temperature的时候就是简单的运用他给你的公式,这里要记住exp()函数的功能是求e的x次方。 当求dewpoint ,我们只要二分,并利用humidex和temperature中的任何一个计算另一个值,观察是否相等,因为在【-100,100】区间范围之内,函数是个单调函数,所以可以根据此来二分。   Humidex Time Limit: 1

922

手把手教你用STM32实现SPWM逆变器控制(附完整代码)

本文详细介绍了如何使用STM32微控制器实现SPWM逆变器控制,包括硬件设计、PWM生成配置、正弦表生成与DMA传输,以及闭环控制与性能优化。通过完整的代码示例和实测数据,帮助开发者快速掌握SPWM技术,应用于新能源和电力电子领域。

weixin_29296241的博客 324

poj日记(3299)

这几天刚上手刷poj的题,先尝试一些简单题,今天3299 Description Adapted from Wikipedia, the free encyclopedia The humidex is a measurement used by Canadian meteorologists to reflect the combined effect of heat and

luantai6098的博客 464

ArcGIS Pro中如何批量替换数据源

不知您是否遇到过下面情况:ArcGIS Pro的Map/Scene中所引用的数据源被移动或重命名了,导致Map/Scene中找不到之前的数据,出现红色叹号;已有一个Map模板文件,图层的样式符号都是设置好的,想批量设置成另外一个数据源,复用该模板文件中的样式符号。 如果您在ArcGIS Pro的使用过程中遇到了上面情况,那么可以参考本篇文章,本文以图层存储在同一GDB中为例介绍。 情况一:Map中已有图层的数据源被移动了 原始Map长这样: 当数据源位置改变之后,显示找不到数据源的红色叹号: 这时如果右

xinying180的博客 7959

网络虚拟化介绍(OVS、DVS)

网络虚拟化概念网络虚拟化就是把网络层的一些功能从硬件中剥离出来,建立新的网络虚拟层;该虚拟层可以接管网络服务和配置,实现网络服务与物理层的解耦,打破物理资源限制;通过网络虚拟层能够在一个物理网络上模拟出多个逻辑网络,并且多用户在逻辑网络上相互隔离,保证网络安全网络虚拟化的特点隔离性:不同租户的流量相互之间不能互访;但是IP/MAC地址都可以独立规划可移动性:虚拟机可以跨二层/三层迁移,甚至可以跨广域网迁移(迁移前后虚拟机Vlan和IP地址都不会发生变化)可扩展性:逻辑网络的规模和数量可扩展。

m0_49864110的博客 1万+

POJ 3299 Humidex Java题解

本文主要是针对POJ-3299-Humidex使用Java实现的相关过程,以及初学者的注意事项。

Exticntion的博客 750

Excel插件开发实战:从零封装一个带自定义Ribbon的.xlam工具包

本文详细介绍了如何从零开发一个带自定义Ribbon的Excel插件.xlam工具包。通过VBA和XML技术,读者将学习到插件架构设计、Ribbon界面定制、模块化开发以及企业级部署策略,帮助提升Excel自动化办公效率。

weixin_42531128的博客 535

2016年上半年openjudge一些零散题目总结

2016年上半年openjudge一些零散题目总结

PKU_ZZY的博客 2619

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

POJ 3299 Humidex

Adapted fromWikipedia, the free encyclopedia The humidex is ameasurement used by Canadian meteorologists to reflect the combined effect ofheat and humidity. It differs from the heat index used in the

emoheithree的博客 428

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

Humidex

Humidex Time Limit:1000MS Memory Limit:65536K Total Submit:24 Accepted:15 Description Adapted from Wikipedia, the free encyclopedia The humidex is a measurement used by Canadian meteorologists

ACM 2081

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

POJ 3299(湿润指数 简单数学) 解题报告

POJ 3299(湿润指数 简单数学) 解题报告

Why So Serious? 1577

POJ - 3299 Humidex

题目链接: 点击打开链接 #include #include #include #include using namespace std; const double d1 = 0.5555; const double d2 = 6.11; const double d3 = 5417.7530; const double d4 = 273.16; int main() {

怕什么真理无穷?进一寸有一寸的欢喜~ 260

poj3299

Humidex Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 11778   Accepted: 4389 Description Adapted from Wikipedia, the free encyclopedia The humidex is a

hechenghai 588

POJ 3299 Humidex(水题)

Humidex Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 16680   Accepted: 6063 Description Adapted from Wikipedia, the free encyclopedia The humidex is a me

pluto227的专栏 710

【POJ3299】Humidex(简单的数学推导)

公式题中已经给出,直接求解即可。 1 #include <iostream> 2 #include <cstdlib> 3 #include <cstdio> 4 #include <cstdlib> 5 #include <cstring> 6 #include <cmath> ...

banxuanliu0005的博客 157

POJ 2361 Tic Tac Toe 模拟

Tic Tac Toe Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 1992   Accepted: 750 Description Tic Tac Toe is a child's game played on a 3 by 3 grid. One playe

kdwycz的刷题空间 1246

POJ 2083 Fractal 递归画分形

Fractal Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 6934   Accepted: 3419 Description A fractal is an object or quantity that displays self-similarity, i

kdwycz的刷题空间 1099
上一篇: POJ 2361 Tic Tac Toe 模拟
下一篇: HDOJ 1847 Good Luck in CET-4 Everybody! 博弈论的多种姿势
kdwycz
博客等级 码龄15年 38粉丝 105原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值