PKU 3299 Humidex

MIT操作系统课程JOS实验讲义(1-7章) MIT6.828操作系统课程的中文讲义。这个资料比较系统,比官网的英文书更好,可以与官网英文书互为补充。 立即下载
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 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<stdlib.h>
#include<math.h>
#include<iostream>
using namespace std;
#define E 2.718281828

double get_e(double d)
{
    return 6.11*pow(E,5417.7530*(1/273.16-1/(d+273.16)));    //题中的两个公式不要合二为一,这个题一合,精度就有损失了 
}
int main()
{
    char ch1,ch2;
    double num1,num2,num3;
    while(cin>>ch1&&ch1!='E')    //有A32 种排法 
    {
        cin>>num1>>ch2>>num2;    //c++的输入很方便 
        if(ch1=='D'&&ch2=='T'){ch1='T';ch2='D';double tmp=num1;num1=num2;num2=tmp;}
        if(ch1=='T'&&ch2=='D')
        {
            num3=num1+0.5555*(get_e(num2)-10.0);
            printf("T %.1f D %.1f H %.1f \n",num1,num2,num3);
        }
        if(ch1=='D'&&ch2=='H'){ch1='H';ch2='D';double tmp=num1;num1=num2;num2=tmp;}
        if(ch1=='H'&&ch2=='D')
        {
            num3=num1-0.5555*(get_e(num2)-10.0);
            printf("T %.1f D %.1f H %.1f\n",num3,num2,num1);
        }
        if(ch1=='T'&&ch2=='H'){ch1='H';ch2='T';double tmp=num1;num1=num2;num2=tmp;}
        if(ch1=='H'&&ch2=='T')
        {
            double temp=log(((num1-num2)/0.5555+10.0)/6.11)/5417.7530;
            num3=1/(1/273.16-temp)-273.16;
            printf("T %.1f D %.1f H %.1f\n",num2,num3,num1);
        }
    }
    return 0;
}


 

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

相关推荐

【深度学习开发环境配置】基于PyTorch的计算机视觉项目依赖管理:requirements.txt文件解析与版本控制方案

内容概要:该文件为一个Python项目的依赖包配置文件(requirements.txt),列出了项目运行所需的软件包及其最低版本要求。主要包括深度学习框架PyTorch及其视觉扩展 torchvision、科学计算库 numpy 和 scipy、数据处理工具 pandas、机器学习库 scikit-learn、图像处理库 opencv-python 和 Pillow,以及数据可视化工具 matplotlib 和 seaborn 等。该配置确保项目在不同环境中具备一致的运行条件。; 适合人群:从事深度学习、计算机视觉或数据科学相关工作的开发者与研究人员,熟悉Python环境管理的技术人员; 使用场景及目标:①用于搭建项目开发环境,确保依赖一致性;②支持模型训练、图像处理、数据分析等任务的环境准备;③便于项目共享与部署,降低环境配置成本; 阅读建议:在实际使用时,建议通过 pip install -r requirements.txt 安装依赖,并根据具体硬件环境适当调整版本兼容性,尤其注意 PyTorch 与 CUDA 版本的匹配。

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

四、zabbix7.0推送告警至钉钉webhook机器人

2、钉钉的webhook是有安全要求的,我采用的是ip的方式,我的zabbix服务器在内网,我的网络出口有多个固定公网ip,所以这样做省事,其他方式也可以你自己考虑。下图是webhook机器人的配置。这一步,参数里面默认的跟我下图里不一样的,按我下图修改。Key是你的webhook机器人地址里的access_token=后面的内容。整个逻辑就是告警动作匹配告警媒介与用户,然后进行告警的发送。1、zabbix服务器能够访问钉钉的服务器,具体说是能访问。二、zabbix7配置报警媒介以及消息模板配置。

m0_74823715的博客 1305

poj-3299 Humidex 水题,推公式

poj-3299 Humidex

Nervending的 591

STM32CubeMX最新版下载安装全攻略(附官网访问问题解决方案)

本文提供了STM32CubeMX最新版的详细下载与安装指南,并针对国内开发者常见的官网访问缓慢、注册验证邮件延迟等问题,给出了实用的解决方案和备选策略。通过清晰的步骤解析,帮助用户快速部署这一强大的STM32图形化配置工具,从而高效启动嵌入式开发项目。

weixin_28256233的博客 201

STM32F407 UART4串口DMA收发实战:告别频繁中断,用空闲中断+DMA搞定不定长数据

本文详细介绍了STM32F407 UART4串口结合DMA和空闲中断实现高效不定长数据收发的实战方案。通过DMA硬件级数据搬运和空闲中断智能帧检测,显著降低CPU占用率,提升通信效率,适用于工业传感器数据采集和智能设备通信场景。

weixin_42631411的博客 161

POJ3299 Humidex 简单二分

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

923

comfyui从入门到精通二:提示词规则详解

《AI绘画提示词使用全指南》摘要: 本文系统解析AI绘画提示词的核心规则与实用技巧。关键点包括:1) 空格与下划线的本质差异,webui会自动转换但comfyui保留原格式;2) 数字与单词表达(如1girl/one girl)会导致风格变化;3) 三种权重控制方式(数值标注、括号嵌套、位置效应),其中数值标注最直观有效;4) 位置衰减公式揭示提示词排序对效果的影响权重。同时指出当前AI绘画仍存在角色一致性等更复杂的技术瓶颈。全文通过多组对比实验,为创作者提供从基础语法到高阶控制的完整解决方案。

ScottePerk的博客 1948

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

手把手教你用Nangate 45nm开源工艺库搞定数字电路仿真(附FreePDK资源)

本文详细介绍了如何使用Nangate 45nm开源工艺库进行数字电路仿真,包括环境搭建、关键文件解析、仿真环境配置及低功耗设计等实战内容。特别推荐FreePDK资源,帮助读者快速掌握从理论到实践的全流程操作,适用于学术研究和小规模数字电路设计。

weixin_30352645的博客 499

35、使用 Geo 创建 GitLab 的分布式只读副本

本文详细介绍了如何使用GitLab Geo功能创建分布式只读副本,涵盖数据库主从配置、SSH密钥查找方式更改、通过Web UI添加从节点、激活哈希存储及状态检查等关键步骤。同时提供了常见问题解答和配置流程图,帮助用户快速部署并维护Geo集群,实现跨地域的高效数据同步与高可用架构。

chair的专栏 84

POJ 3299 Humidex

题目:三个变量temperature,dewpoint,humidex有以下关系: humidex = temperature + h h = (0.5555)× (e - 10.0) e = 6.11 × exp [5417.7530 × ((1/273.16) - (1/(dewpoint+273.16)))] 任务是根据其中任意两个数,计算出第三个数。 输入:输入的每一行由

路漫漫其修远兮,吾将上下而求索 2170

PY32F406K1CU6 FLASH模拟EEPROM

摘要:本文介绍了基于STM32 FLASH模拟EEPROM的实现方法。头文件flash.h定义了FLASH页大小(256字节)、用户存储区域(4页)及地址范围,提供了等待周期配置和地址校验宏,声明了EEPROM初始化、读写操作等函数接口。源文件flash.c实现了具体功能:配置FLASH等待周期(144MHz需3WS)、页读写擦除操作,以及EEPROM初始化(解锁-擦除-验证-锁定)和缓冲区读写功能。其中写操作采用"读页→更新→擦除→编程"的流程,确保数据安全写入。该方案适用于需要非易失

sam的博客 199

pku3299

简单的数学一元方程求解问题,分情况讨论即可.题目中给出的是3个等式,最好将其中可以直接计算的部分算出,并且将其合并为一个方程,这样不仅可以减少运行中用于相同运算的时间,还有利于更好的求解.不过,该题的一个关键点还是输入输出的处理.在使用cout.precision()时才发现它不是设定小数位数的,而是设定有效数字的位数,纠正一个错误.Source:#include#includ

0.5 Degree 830

cefshap(C#)定义浏览器的右键菜单

菜单效果:复制(自带),搜索文本,打开链接,复制链接,刷新,检查,关于 public class MenuHandler : IContextMenuHandler { //public event Action<string> PopupRequest; void IContextMenuHandler.OnBeforeContextMenu(IWebBrowser browserControl, IBrows

无线智能模块 可视DIY智能专家 1714

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

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 2082

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

POJ 3299 Humidex 模拟数学题

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

kdwycz的刷题空间 1097

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

hdu 1001 Java大数简单方法

Sum ProblemProblem DescriptionHey, welcome to HDOJ(Hangzhou Dianzi University Online Judge).In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + … + n.InputThe input will consist of a series

wilver的博客 1430

北大ACM - POJ试题分类 (2017整理版)

北大ACM - POJ试题分类 (2017整理版)—— By EXP 2017-12-03

ζёСяêτ - 小優YoU 5万+

ACM POJ3299-Humidex

#include <iostream> #include <cstdio> #include <cmath> #define MAXN 101 using namespace std; int main() { char c; double t,d,h; while(1) { t ...

weixin_30467087的博客 153

Leetcode 解题报告

据说刷完leetcode是准备编程面试的第一步。想到明年可能就要开始找工作了,先准备着吧。 计划今年11月份前做完,大概平均每天2-3题,难度应该不大,贵在坚持! 代码放在github上,地址:https://github.com/xingjian-f/Leetcode-solution 简略解题报告 1 Two Sum 三种解法: 1 暴力枚举所有的两两组合,检查它们的和是否等于

勿忘初衷 1万+

LOJ#6397. 「THUPC2018」蛋糕 / Cake(暴力dfs)

传送门 思路跟这题一样的。 但不能直接用组合数算因为边长不一样。。。 于是可以dfsdfsdfs,复杂度O(T∗2n),n≤4O(T*2^n),n\le4O(T∗2n),n≤4,注意要特判边长等于一的情况。 代码: #include<bits/stdc++.h> #define ri register int using namespace std; const int rlen=1&...

苟为蒟蒻又何妨 495
上一篇: POJ 题目分类
下一篇: HDU_1048 The Hardest Problem Ever
yuniZZ
博客等级 码龄13年 4粉丝 107原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值