Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
输入有点坑。。。。#include<cstdio> #include<math.h> #include<algorithm> float t,d,h,e,H; char n; int main(){ while(scanf("%c",&n)!=EOF){ t=50000; d=50000; h=50000; switch(n){ case 'T' :scanf("%f",&t);break; case 'D' :scanf("%f",&d);break; case 'H' :scanf("%f",&h);break; case 'E' :return 0; } getchar(); scanf("%c",&n); switch(n){ case 'T' :scanf("%f",&t);break; case 'D' :scanf("%f",&d);break; case 'H' :scanf("%f",&h);break; case 'E' :return 0; } getchar(); if(h==50000&&t!=50000&&d!=50000){ e = 6.11*pow(2.718281828,(5417.7530*((1/273.16)-(1/(d+273.16))))); H=0.5555*(e-10.0); h=t+H; } else if(t==50000&&h!=50000&&d!=50000){ e = 6.11*pow(2.718281828,(5417.7530*((1/273.16)-(1/(d+273.16))))); H=0.5555*(e-10.0); t=h-H; } else if(d==50000&&h!=50000&&t!=50000){ H=h-t; e=(H/0.5555)+10.0; d=(1/(-log(e/6.11)/5417.7530+(1/273.16))-273.16); } printf("T %.1f D %.1f H %.1f\n",t,d,h); } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator