c++

wch123 发表于 1年前 · 关联问题 一元二次方程求解

include

include <math.h>

using namespace std;

int main() {

int a,b,c; cin>>a>>b>>c; if ((b*b-4*a*c)>=0){ cout<<"YES"<<endl; cout<<(-b+pow(b*b-4*a*c,0.5 ))/(2*a)<<endl; cout<<(-b-pow(b*b-4*a*c,0.5 ))/(2*a)<<endl; }else{ cout<<"NO"<<endl; } }