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

疯狂求助

Posted by 3008216013 at 2010-05-23 09:52:11 on Problem 2006
这题还有什么陷进吗???怎么过了simple还是wa
代码如下:
#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
int main(void)
{
	double a,b,c,d,e,f,res;
	char h1[10],h2[10];
	cin>>h1;
	while(h1[0]!='0')
	{
		a=h1[0]-48+0.1*(h1[2]-48);
		b=(h1[6]-48)*(-1);
		cin>>h2;
		c=h2[0]-48+0.1*(h2[2]-48);
		d=h2[6]-48;

		cin>>e>>f;

		a=a*pow(10.0,b);
		c=c/pow(10.0,d);
	

		f=f/e;
		e=1/e;
		res=(sqrt(a*a*e*e+4*a*c*f)-a*e)/(2*f);
		cout<<fixed<<setprecision(3)<<log10(1/res)<<endl;
		cin>>h1;
	}
	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