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. python学习笔记(二)— 列表(list)

    列表也叫数组,列表定义,使用[]即可:列表里面可以再套列表,一个里面套一个列表,叫二维数组:一个里面套一个列表,里面的列表再套一个列表,这个叫三维数组,套几层就是几维,定义格式如下: list1 = ...

  2. python - 用户交互/数据类型/格式化输出/运算符/流程控制单双多分支

    python:用户交互: 等用户输入,做反应: username=input("username:")password=input("password:")pr ...

  3. json中load和loads区别

    相同点 dump 和 dumps 都实现了序列化 load 和 loads 都实现反序列化 变量从内存中变成可存储或传输的过程称之为序列化序列化是将对象状态转化为可保存或可传输格式的过程. 变量内容从 ...

  4. JavaWeb-Servlet-通过servlet生成验证码图片

    BufferedImage类 创建一个BufferImage servlet,用来生成验证码图片: package com.fpc; import java.awt.Color; import jav ...

  5. Spring框架第六篇之Spring与DAO

    一.Spring与JDBC模板 1.搭建环境 首先导入需要的jar包: 以上jar中多导入了DBCP和C3P0的jar包,因为这里需要演示怎么配置多种数据源,所以导入了这两个包,在实际开发中无需导入这 ...

  6. Oracle 常见问题汇总

    1.Listener refused the connection with the following error 安装之后如果遇到如下问题状态: 失败 -测试失败: Listener refuse ...

  7. 手把手教 GitHub + Hexo 搭建博客

    前言 在很久以前,博主就想着要有自主的博客专栏或者网站.经历了博客园这个需要所谓的编辑审核,一直比较困惑,这些编辑是什么出身,怎么知道技术博客的价值性. 接下来找到了开源中国,这个可以自由发言的地方. ...

  8. Get a better look at the 2014 Nike Hyperrev

    There's a couple of Nike Hyperrev For Sale Delay climax frames lead that will list for this calendar ...

  9. PKU 2002 Squares(二维点哈希+平方求余法+链地址法)

    题目大意:原题链接 给定平面上的N个点,求出这些点一共可以构成多少个正方形. 解题思路: 若正方形为ABCD,A坐标为(x1, y1),B坐标为(x2, y2),则很容易可以推出C和D的坐标.对于特定 ...

  10. 7. Reverse Integer(翻转整数)

    Given a 32-bit signed integer, reverse digits of an integer. Example 1: Input: 123 Output: 321 Examp ...