Humidex

poj3299 Humidex(公式直接算) 水题 有一丢丢技巧的输入,再带上三个个公式的计算 代码思路和格式蛮漂亮的,可以借鉴 #include<iostream> #include<cmath> #define exp 2.718281828 using namespace std; double geth(double t,double d){ double h,e; e=6.11*pow(exp,5417.7530*((1/273.16)-(1/(d+273.16)))); h=0.5555*(e-10); r 阅读详情

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 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
简单的数学问题
代码:
  • #include<stdio.h>
    #include<math.h>
    int main()
    {
    	char ch1,ch2;
    	double te,de,hu,h,e,a,b;
        while(scanf("%c",&ch1)!=EOF)
    	{
    		if(ch1=='E')break;
    		scanf("%lf %c %lf",&a,&ch2,&b);
    		te=200;de=200;hu=200;
    		if(ch1=='T')te=a;
    		else if(ch1=='D')de=a;
    		else if(ch1=='H')hu=a;
    		if(ch2=='T')te=b;
    		else if(ch2=='D')de=b;
    		else if(ch2=='H')hu=b;
    		if(te!=200&&de!=200)
    		{
    			e=6.11*exp(5417.7530*((1.0/273.16)-(1.0/(de+273.16))));
    			h=(0.5555)*(e-10.0);
    			hu=te+h;
    			printf("T %.1f D %.1f H %.1f\n",te,de,hu);
    			continue;
    
    		}
    		else if(te!=200&&hu!=200)
    		{
    			h=hu-te;
    			e=h/0.5555+10.0;
    			de=1.0/((1.0/273.16)-log(e/6.11)/5417.7530)-273.16;
    			printf("T %.1f D %.1f H %.1f\n",te,de,hu);
    			continue;
    		}
    		else if(hu!=200&&de!=200)
    		{
    			e=6.11*exp(5417.7530*((1.0/273.16)-(1.0/(de+273.16))));
    			h=(0.5555)*(e-10.0);
    			te=hu-h;
    			printf("T %.1f D %.1f H %.1f\n",te,de,hu);
    			continue;
    
    
    		}
    	}
    	return 0;
    }
    

Humidex:湿度指数(“湿度指数”的缩写)是一种用于通过结合热和湿度的影响来描述普通人感觉天气有多热的量表。 (这是加拿大 Humidex 不是美国热量指数) Humidex 湿度指数(“湿度指数”的缩写)是一种用于通过结合热和湿度的影响来描述普通人感觉天气有多热的量表。 (这是加拿大 Humidex 不是美国热量指数)。 您可以在查看正在运行的 PHP 示例代码。 我最初编写这个软件是我在 2015 年夏季从事的物联网项目的一部分,但我找不到可以计算 Humidex 的 PHP 代码,所以我发布了我自己的版本。 感谢您花时间看这个项目,希望对您有用, 康纳沃尔什。 立即下载

相关推荐

IEEE投稿完整流程——以IEEE Transactions on Cybernetics为例【附:论文格式模板】

前言 以下是官方的流程,包括了论文的格式和提交的流程,重要!重要!重要! 在IEEE的官网中,也有论文提交的文件 可以直接参考: 中文版: 作者指南 英文版: Manuscripts-Author-Guide 作者指南的版本指导流程可能和最新版的官网不一致!!! 或者在下面的链接中,按照你的论文类型,选择不同的论文模板: IEEE article template 以下以IEEE Transactions on Cybernetics 为例子 IEEE Transactions on Cyberne

XC___XC的博客 10万+

算法课作业1

就把中间通道编号,奇数和偶数的编号调成1-200,之后对区间进行累加,重合次数最多的就是最小时间。注意坑就是,区间不一样从小到大,l,r要判断一下大小。两排都是房间,一排两百个房间,上面按奇数,下面按偶数编号,之后房间两两之间要搬桌子,搬桌子期间中间通道全部占用,可同步进行,搬一次10分钟,求最小时间。求e的对数有log函数,不懂为什么不会出精度错误,很迷,给的三个数字也没有顺序,需要多判断。给三个类型数字通过公式来回转化。

qq_67586914的博客 428

Unity 2021 LTS安装避坑指南:从下载到第一个3D项目的完整流程

本文提供了一份详尽的Unity 2021 LTS安装与首个3D项目创建指南。内容涵盖从Unity Hub下载、版本选择、模块安装避坑,到编辑器界面解析、创建旋转立方体脚本的完整流程,旨在帮助初学者快速搭建稳定开发环境并上手核心操作。

mango的博客 318

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

PCB设计必看:铜皮厚度与载流能力对照表(附Excel计算工具)

本文深入解析了PCB设计中铜皮厚度与载流能力的核心关系,提供了基于IPC-2152标准的动态计算逻辑与实用Excel工具。文章不仅分享了载流对照表,更重点剖析了影响载流能力的关键因素(如铜厚、线宽、温升、布线层),并给出了高电流设计的实战技巧与测试验证方法,帮助工程师规避常见陷阱,实现从理论到实践的闭环设计。

weixin_29228781的博客 738

嵌入式AI实战:基于RK3588部署YOLOv11并集成OpenCV实现实时推理(全流程详解)

本文详细介绍了在RK3588芯片上部署YOLOv11目标检测模型的全流程,包括环境搭建、模型转换和实时推理实现。主要内容为:1)通过YOLOv11官方工具将PyTorch模型转为ONNX格式;2)使用RKNN Toolkit2将ONNX模型转换为适配RK3588的RKNN格式;3)在RK3588上结合OpenCV实现实时视频推理功能。教程提供了完整的代码示例和详细步骤说明,帮助开发者快速在边缘设备上部署目标检测模型,实现AI视觉应用的落地。

LXY_LOVE36的博客 219

poj-3299 Humidex 水题,推公式

poj-3299 Humidex

Nervending的 591

如何用libwebsocket库在stm32F407上实现websocket客户端?

🏆本文收录于 《全栈 Bug 调优(实战版)》 专栏。专栏聚焦真实项目中的各类疑难 Bug,从成因剖析 → 排查路径 → 解决方案 → 预防优化全链路拆解,形成一套可复用、可沉淀的实战知识体系。无论你是初入职场的开发者,还是负责复杂项目的资深工程师,都可以在这里构建一套属于自己的「问题诊断与性能调优」方法论,助你稳步进阶、放大技术价值 。

**My Coding Family** 1141

POJ 3299 - Humidex

Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 15668   Accepted: 5722 Description Adapted from Wikipedia, the free encyclopedia The humidex is a measurement used by

Latte_z的小站 592

SAP_MM模块通过CC11 创建物料版本

通过本文,我们了解了 SAP 的[SAP_MM模块通过CC11 创建物料版本]的基本概念和应用方法。当物料主数据、BOM(物料清单)、工艺路线等对象需要进行变更控制时,通过创建“版本”或“更改单”来记录、控制和追溯变更。创建完变更主记录(Change Number)后,可在物料主数据维护时引用它,从而创建物料版本化信息。,在其中可以定义物料、BOM、工艺路线等对象的变更版本信息,从而在系统中实现版本化的物料管理。

我小时候很黑的博客 827

Python爬虫实战:模拟登录B站 – 处理Cookie和加密参数

由于B站在登录过程中采用了多种安全措施,包括加密的请求参数和cookie验证,模拟登录成为一项具有挑战性的任务。首先,我们需要获取B站的登录页面,并解析出其中的CSRF令牌和其他隐藏的字段。B站的登录接口通常会包含一些动态的加密参数,我们需要在登录前通过GET请求获取这些信息。本文详细介绍了如何使用Python模拟登录B站,解决加密参数的处理、图形验证码的识别以及登录后的数据抓取。库中的加密方法加密登录请求中的密码。一旦登录成功,我们可以通过维护会话状态,抓取登录后的数据,如个人主页、评论、观看记录等。

2201_76125261的博客 1314

程序证明与形式化验证:从理论到工程实践

程序证明作为计算机科学的重要分支,旨在通过数学方法确保软件行为的绝对正确性。其核心原理是形式化验证,即使用形式化语言对系统进行精确描述,并通过逻辑推理证明其满足特定属性。这项技术的价值在于能够提供超越传统测试的逻辑完备性保证,从根本上提升软件的可信度。在工程实践中,形式化验证已应用于安全关键系统、密码学实现、操作系统内核等场景,通过自动化工具链(如SMT求解器)降低验证负担。例如,Project Everest项目采用分层验证策略,聚焦于构建完全形式化验证的HTTPS协议栈,为互联网安全通信打造数学意义上的

weixin_30325971的博客 362

【虚幻引擎UE】UE5 可编辑动态样条线轨迹及AI跟随路径移动(含工程源码)

【虚幻引擎UE】可编辑动态样条线轨迹及AI跟随路径移动

灵境引路人 6231

Poj 3299 Humidex

1.链接: http://poj.org/problem?id=3299 2.题目: Humidex Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 16705   Accepted: 6078 Description Adapted from Wikip

西门求雪的专栏 384

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

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

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

Poj3299——Humidex

题目 T he 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 rath...

qq_42770849的博客 406

锂电池充电器电路设计 里面有电路

锂电池充电器电路设计 里面有电路 3.7V升压到5V电路设计。

POJ3299Humidex(JAVA

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

Gluskin的博客 464

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

POJ - 3299 Humidex

Humidex Time Limit: 1000MS   Memory Limit: 65536KB   64bit IO Format: %I64d & %I64u Submit Status Description Adapted from Wikipedia, the free encyclopedia The humidex

acm_1361677193的专栏 351

Poj3299 Humidex java 分析

这题主要是考研 枚举 的思路, 读清题目, 找到关键要枚举的内容十分重要, 在第一次写的时候忽略了有“H”的可能,好在代码量不大,后期修改很方便。 题目中提到的数据的范围[-100, 100], 所以就可以用设置超值过滤的方式去筛选。 结合枚举的可能实例,公式要发生变化,可以写一行,可以分开写, 题目对内存占用还是放的很宽的,所以可以想定义几个变量就定义几个。 这里可以不用考虑先除减再加乘,和除0

qq_28052721的博客 529

POJ 3299 Humidex Java题解

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

Exticntion的博客 750

POJ3299 Humidex;c++求对数

问题: Humidex Time Limit:1000MS Memory Limit:65536K Total Submissions:25255 Accepted:8924 Description Adapted from Wikipedia, the free encyclopedia The humidex is a measureme...

s0il的博客 405

PKU 3299 Humidex

Humidex

yuniZZ的专栏 488

POJ---3299 Humidex

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

pan_00_hao的专栏 639
上一篇: Lot
下一篇: 阶乘问题
a1647566717
博客等级 码龄15年 15粉丝 74原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值