Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

麻烦帮忙看一下,为什么总是wa?

Posted by 1010311201 at 2012-02-22 13:34:26 on Problem 3299
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator