1 solutions
-
1
太难辣,首AC居然是我
#include<bits/stdc++.h> using namespace std; double a,b,c; int main(){ cin>>a>>b>>c; double delta=b*b-4*a*c; if(delta==0){ cout<<"x1=x2="<<fixed<<setprecision(5)<<(-1*b/(2*a)); } else if(delta>0){ double x1=((-1*b)+sqrt(b*b-4*a*c))/(2*a); double x2=((-1*b)-sqrt(b*b-4*a*c))/(2*a); cout<<"x1="<<fixed<<setprecision(5)<<min(x1,x2)<<';'<<"x2="<<fixed<<setprecision(5)<<max(x1,x2); } else cout<<"No answer!"; return /*164*/0; }
- 1
Information
- ID
- 6897
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- 1
- Tags
- # Submissions
- 28
- Accepted
- 2
- Uploaded By