POJ 3299 Humidex(简单题)

【题意简述】:就是什么温度,湿度……,之间的转换。。

【分析】:公式已给出了。

// 252k 0Ms
/*
	其中exp表示的是求e的x次幂
	解法就直接根据题目中的公式解决就好!!
*/
#include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;

int main()
{
	double t,d,h;
	char alpha;
	while(1)
	{

		t = d = h = 101;
		for(int i = 0;i<2;i++)
		{
			cin>>alpha;
			if(alpha == 'E') return 0;

			else if(alpha == 'T')
				cin>>t;
			else if(alpha == 'D')
				cin>>d;
			else
				cin>>h;
		}

		if(h == 101)
			h=t+0.5555*(6.11*exp(5417.7530*(1/273.16-1/(d+273.16)))-10);
		if(d == 101)
			d=1/((1/273.16)-((log((((h-t)/0.5555)+10.0)/6.11))/5417.7530))-273.16;
		if(t == 101)
			t=h-0.5555*(6.11*exp(5417.7530*(1/273.16-1/(d+273.16)))-10);
		cout<<setprecision(1)<<fixed<<"T "<<t<<" D "<<d<<" H "<<h<<endl;
	}
}
时间: 2024-07-31 14:33:33

POJ 3299 Humidex(简单题)的相关文章

POJ 3299 Humidex 难度:0

题目链接:http://poj.org/problem?id=3299 #include <iostream> #include <iomanip> using namespace std; double exp(double x){ double ans=1; double td=1; for(int i=1;i<120;i++){ td=td*x/i; ans+=td; } return ans; } const double ine= 2.718281828 ; dou

POJ 3094 Quicksum(简单题)

[题意简述]:题意很简单.看例子就能理解 [分析]:略.字符串的读取操作. // 200K 0Ms #include<iostream> using namespace std; int main() { char a[256]; while(1) { int sum = 0; gets(a); if(strcmp(a,"#")==0) break; int len = strlen(a); for(int i = 0;i<len;i++) { if(a[i] ==

POJ - 3299 Humidex

题意:已知两数,根据公式求第三个数. 分析: 1..lfG++编译不过的C++可能编译过. 2.输出.lf改成.f后G++可编译过. #pragma comment(linker, "/STACK:102400000, 102400000") #include<cstdio> #include<cstring> #include<cstdlib> #include<cctype> #include<iomanip> #incl

POJ 2393 贪心 简单题

有一家生产酸奶的公司,连续n周,每周需要出货numi的单位,已经知道每一周生产单位酸奶的价格ci,并且,酸奶可以提前生产,但是存储费用是一周一单位s费用,问最少的花费. 对于要出货的酸奶,要不这一周生产,要不提前生产. 什么时候采用什么生产方式呢? 若第i周的货提前生产的话,假设在j周生产,则费用为(i-j)*s+c[j] 若c[i]>(i-j)*s+c[j],则更新c[i]=(i-j)*s+c[j] 更新要O(n^2)? 可以证明,最优的生产方式是,要不在这一周生产,要不在上一周生产(这里的上

poj 3270 Cow Sorting 置换群 简单题

假设初始状态为 a:2 3 1 5 4 6 则目标状态为 b:1 2 3 4 5 6且下标为初始状态中的3 1 2 4 5 6(a[3],a[1]...) 将置换群写成循环的形式 (2,3,1),(5,4),6就不用移动了. 移动方式2种 1:选循环内最小的数和其他len-1个数交换 2:选整个序列最小的数和循环内最小的数交换,转到1,再换回来. #include<cstdio> #include<queue> #include<algorithm> #include&

poj 3112 Digital Biochemist Circuit(简单题)

题目链接:http://poj.org/problem?id=3112 Digital Biochemist Circuit Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 876   Accepted: 375 Description A digital biochemist circuit (DBC) is a device composed of a set of processing nodes. Each pro

POJ Frogs&#39; Neighborhood havel-hakimi定理 (简单题)

Frogs' Neighborhood Time Limit: 5000MS   Memory Limit: 10000K Total Submissions: 8263   Accepted: 3504   Special Judge Description 未名湖附近共有N个大小湖泊L1, L2, ..., Ln(其中包括未名湖),每个湖泊Li里住着一只青蛙Fi(1 ≤ i ≤ N).如果湖泊Li和Lj之间有水路相连,则青蛙Fi和Fj互称为邻居.现在已知每只青蛙的邻居数目x1, x2, ..

POJ 2405 Beavergnaw (计算几何-简单题)

Beavergnaw Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 6203   Accepted: 4089 Description When chomping a tree the beaver cuts a very specific shape out of the tree trunk. What is left in the tree trunk looks like two frustums of a co

POJ 2909 Goldbach&#39;s Conjecture(简单题)

[题意简述]:输入一个数,输出有几对素数对可以使他们的和正好等于这个数 [分析]:暴力打表,再暴力循环求解 //268K 125Ms #include<iostream> using namespace std; #define N 35000 // 2^15 bool isprime[N]; int prime[N],nprime;//prime[N]用来存储素数,nprime是此时一共有多少素数 void doprime(int n) { int i,j; nprime = 1; mems