| ||||||||||
| 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 | |||||||||
疯狂求助这题还有什么陷进吗???怎么过了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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator