| 记录编号 |
417939 |
评测结果 |
AAAAAAAAAA |
| 题目名称 |
1404.一元二次方程求解 |
最终得分 |
100 |
| 用户昵称 |
NVIDIA |
是否通过 |
通过 |
| 代码语言 |
C++ |
运行时间 |
0.000 s |
| 提交时间 |
2017-06-28 18:05:34 |
内存使用 |
0.00 MiB |
显示代码纯文本
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
using namespace std;
int a,b,c;double d,x,x2;
inline int read()
{
int x,f=1;char ch;
while(ch=getchar(),!isdigit(ch))if(ch='-')f=-1;x=ch-48;
while(ch=getchar(),isdigit(ch))x=x*10+ch-48;return x*f;
}
inline int miao()
{
freopen("trouble.in","r",stdin);
freopen("trouble.out","w",stdout);
a=read(),b=read(),c=read();d=b*b-4*a*c;
if(d<0)cout<<"No Answer!"<<endl;
else{x=(-b+sqrt(d))/(2*a);x2=(-b-sqrt(d))/(2*a);printf("%.3lf %.3lf",x,x2);}
}
int aaa=miao();
int main(){;}