6 条题解

  • 0
    @ 2023-6-26 17:02:58
    #include<bits/stdc++.h>
    #include<cmath>
    #include<iomanip>
    
    using namespace std;
    
    int main(){
    double a,b,c;
    double x1,x2;
    cin>>a>>b>>c;
    x1=( -b-sqrt(b*b-4*a*c) )/(2*a);
    x2=( -b+sqrt(b*b-4*a*c) )/(2*a);
    if(b*b-4*a*c>0){
    cout<<fixed<<setprecision(5)<<"x1="<<x1<<";"<<"x2="<<x2;
    }
    else if(b*b-4*a*c==0){
    cout<<fixed<<setprecision(5)<<"x1=x2="<<x1;
    }
    else{
    cout<<"No answer!";
    }
    return 0;
    }
    

    [ybt]1047 判断能否被3,5,7整除

    信息

    ID
    605
    时间
    1000ms
    内存
    256MiB
    难度
    6
    标签
    (无)
    递交数
    470
    已通过
    150
    上传者