water~2
1947 단어 water
http://poj.org/problem?id=3299
#include <iostream>
#include <fstream>
#include <cmath>
#define EXP 2.718281828
using namespace std;
double funcE(double dewPoint)
{
return 6.11*pow(EXP,5417.7530*((1.0/273.16)-(1.0/(dewPoint+273.16))));
}
double funcH(double t,double d)
{
return t+0.5555*(funcE(d)-10.0);
}
double funcT(double h,double d)
{
return h-0.5555*(funcE(d)-10.0);
}
double funcEToD(double e)
{
return 1.0/(1.0/273.16-log(e/6.11)/5417.7530)-273.16;
}
double funcD(double t,double h)
{
return funcEToD((h-t)/0.5555+10.0);
}
int main()
{
//ifstream cin("1.txt");
char ca,cb;
double a,b;
while(1)
{
cin>>ca;
if(ca=='E')
break;
cin>>a>>cb>>b;
if(ca=='T' && cb=='D')
printf("T %.1f D %.1f H %.1f
",a,b,funcH(a,b));
else if(ca=='D' && cb=='T')
printf("T %.1f D %.1f H %.1f
",b,a,funcH(b,a));
else if(ca=='T' && cb=='H')
printf("T %.1f D %.1f H %.1f
",a,funcD(a,b),b);
else if(ca=='H' && cb=='T')
printf("T %.1f D %.1f H %.1f
",b,funcD(b,a),a);
else if(ca=='H' && cb=='D')
printf("T %.1f D %.1f H %.1f
",funcT(a,b),b,a);
else if(ca=='D' && cb=='H')
printf("T %.1f D %.1f H %.1f
",funcT(b,a),a,b);
}
return 0;
}
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
poj 1205 Water Treatment Plants-DP+ 고정밀제목이 너무 헷갈려서... 한 라인에'N개의 도시가 있는데 오수 처리 시스템에 연결되어 있고 각 도시는 세 가지 선택이 있다. 1. 자신의 오수를 강에 배출하기 V 2. 자신의 오수를 오른쪽으로 보낸다> 3. 자신의...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.