2017-08-31 19:08:25

writer:pprp

水题:

没有技术含量hhh

但是,还是花了很长时间,以后水题也是很有必要练习的

/*
@theme:poj 3299
@writer:pprp
@declare:刷poj上的题,水题要提高速度,还有理解题意的能力
@date:2017/8/31
*/ #include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring> using namespace std; const double e = 2.718281828;
const double tmp = 273.16;
const double tmp2 = 5417.7530;
const double tmp3 = 0.5555; //求humidex
//test:ok
double fun1(double t, double d)
{ double e = 6.11 * exp(tmp2*((/tmp) - (/(d+tmp))));
double h = tmp3 * (e - 10.0);
return t + h;
}
//求temperature
//test:
double fun2(double h, double d)
{
double e = 6.11 * exp(tmp2*((/tmp) - (/(d+tmp))));
double h2 = tmp3 * (e - 10.0);
return h - h2;
}
//求dew point
//test:
double fun3(double h, double t)
{
double h2 = h - t;
double e = h2/tmp3 + 10.0;
return 1.0/(1.0/tmp -((log(e)-log(6.11))/tmp2)) - tmp;
}
/*
int main()
{
double t , d;
cin >> t >> d;
printf("%.1f",fun1(t,d)); return 0;
}
*/ int main()
{ //freopen("in.txt","r",stdin);
char A, B;
double a = , b = ;
char buff[];
while(gets(buff) && strcmp(buff,"E") != )
{
sscanf(buff,"%c %lf %c %lf",&A, &a, &B, &b);
// cout << A << endl;
// cout << a << endl;
// cout << B << endl;
// cout << b << endl;
if(A == 'T')
{
if(B == 'D')
{
// cout << "tag" << endl;
printf("T %.1f D %.1f H %.1f\n",a,b,fun1(a,b));
}
else if(B == 'H')
{
printf("T %.1f D %.1f H %.1f\n",a,fun3(b,a),b);
} }
else if(A == 'D')
{
if(B == 'H')
{
printf("T %.1f D %.1f H %.1f\n",fun2(b,a),a,b);
}
else if(B == 'T')
{
printf("T %.1f D %.1f H %.1f\n",b,a,fun1(b,a));
} }
else if(A == 'H')
{
if(B == 'T')
{
printf("T %.1f D %.1f H %.1f\n",b,fun3(a,b),a);
}
else if(B == 'D')
{
printf("T %.1f D %.1f H %.1f\n",fun2(a,b),b,a);
}
} } return ;
}

注意:double型的要用lf否则就会出错

poj3299 - Humidex的更多相关文章

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

    公式题中已经给出,直接求解即可. #include <iostream> #include <cstdlib> #include <cstdio> #include ...

  2. poj3299

                                                                                                         ...

  3. F - Humidex(1.4.2)

    Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Submit Status Descr ...

  4. 3299 Humidex

    Humidex Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 23219   Accepted: 8264 Descript ...

  5. POJ 3299 Humidex 难度:0

    题目链接:http://poj.org/problem?id=3299 #include <iostream> #include <iomanip> using namespa ...

  6. poj 3299 Humidex

    直接套公式就可以,可我套公式第一遍都错了,英语差的孩子伤不起(┬_┬) #include <iostream> #include <cmath> #include <io ...

  7. POJ 3299 Humidex(简单的问题)

    [简要题意]:什么是温度,湿度--,之间的转换.. [分析]:式已被赋予. // 252k 0Ms /* 当中exp表示的是求e的x次幂 解法就直接依据题目中的公式解决就好!! */ #include ...

  8. Humidex POJ - 3299 (数学)

    题目大意 给定你三个变量中的两个输出剩下的那一个 题解 没有什么,就是把公式推出来即可,完全的数学题 代码 #include <iostream> #include <cmath&g ...

  9. 【转】POJ题目分类推荐 (很好很有层次感)

    OJ上的一些水题(可用来练手和增加自信) (poj3299,poj2159,poj2739,poj1083,poj2262,poj1503,poj3006,poj2255,poj3094)初期: 一. ...

随机推荐

  1. [已解决]centos6.4 php连接mysql和memcache提示权限不允许

    昨天新安装了64位系统,所以就重新安装了一个centos的虚拟机,配置了一个测试环境,刚开始是页面打不开,这个确定是selinux规则没有设置好使用如下命令解决: chcon -R -h -t htt ...

  2. 小程序 修改按钮button样式:去边框、圆角及文字居左对齐、修改按钮高度

    因为有要button和view显示的样式相同的需要 所以要去掉按钮的边框,圆角,背景色,文字需要居左对齐,代码如下: 关键是按钮的样式: 1. 去掉边框: .user-phone-btn::after ...

  3. android开发笔记(二)导入项目到eclipse和另一个项目

    NND,eclipse里导入工程出现问题了,整了半天,来个这问题,无效工程描述,找了半天看.projec文件是否工程名对应,看androidManifest.XML换里面的代码版本号,我擦都无济于事. ...

  4. 前端开发 - CSS - 上

    CSS: 1.css的引入方式 2.基础选择器 3.高级选择器 4.选择器的优先级 5.伪类选择器 6.字体样式 7.文本样式 8.背景 9.盒模型border 10.margin 11.paddin ...

  5. Best Reward---hdu3613(manacher 回文串)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3613 题意就是给你一个串s 然后求把s分成两部分之后的价值总和是多少,分开的串 如果是回文那么价值就是 ...

  6. go学习笔记二:运行使用命令行参数

    本文只作为博主的go语言学习笔记. 对命令行参数的解析,只是在运行时使用的,比如以下命令:go run gomain -conf conf.toml 没有办法再go build时使用. 一.运行时命令 ...

  7. 利用AES算法加密数据

    准备工作: 模块安装问题: 首先在python中安装Crypto这个包 但是在安装模块后在使用过程中他会报错 下面是解决方法: pip3 install pycrypto 安装会报错 https:// ...

  8. mysql 约束条件 auto_increment 自动增长 创建表时设置自增字段

    auto_increment mysql) )auto_increment; Query OK, rows affected (0.01 sec) mysql> show create tabl ...

  9. srs(srs-librtmp推送h264原始数据)

    1.下载最新srs源码 https://github.com/ossrs/srs/releases 2.编译(进入~/srs-2.0-r4/trunk目录) ./configure --with-li ...

  10. sdut3140 A*B(math)

    题目:传送门 题目描述 Your task is to find the minimal positive integer number Q so that the product of digits ...