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 |
麻烦帮忙看一下,为什么总是wa?#include<iostream> #include<math.h> #include<iomanip> using namespace std; int main() { char a,b; double e,h,T,D,H; while(cin>>a&&a!='E') { if(a=='T') { cin>>T; cin>>b; if(b=='D') { cin>>D; e=6.11*exp(5417.7530*(1/273.16-(1/(D+273.16)))); h=0.5555*(e-10.0); H=T+h; } else { cin>>H; h=H-T; e=(h/0.5555)+10.0; D=1/(1/273.16-((log(e)-log(6.11))/5417.7530))-273.16; } } else { if(a=='H') { cin>>H; cin>>b; if(b=='T') { cin>>T; h=H-T; e=(h/0.5555)+10.0; D=1/(1/273.16-((log(e)-log(6.11))/5417.7530))-273.16; } else { cin>>D; e=6.11*exp(5417.7530*(1/273.16-(1/(D+273.16)))); h=0.5555*(e-10.0); T=H-h; } } else { cin>>D; cin>>b; if(b=='T') { e=6.11*exp(5417.7530*(1/273.16-(1/(D+273.16)))); h=0.5555*(e-10.0); H=T+h; } else { e=6.11*exp(5417.7530*(1/273.16-(1/(D+273.16)))); h=0.5555*(e-10.0); T=H-h; } } } cout<<fixed<<setprecision(1)<<"T "<<T<<" D "<<D<<" H "<<H<<endl; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator