K
Khách

Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.

19 tháng 12 2021

Bài 2:

#include <bits/stdc++.h>
using namespace std;
double a,b,c,delta,x1,x2;
int main()
{
    //freopen("PTB2.inp","r",stdin);
    //freopen("PTB2.out","w",stdout);
    cin>>a>>b>>c;
    delta=(b*b-4*a*c);
    if (delta<0) cout<<"-1";
    if (delta==0) cout<<fixed<<setprecision(5)<<(-b/(2*a));
    if (delta>0)
    {
        x1=(-b-sqrt(delta))/(2*a);
        x2=(-b+sqrt(delta))/(2*a);
        cout<<fixed<<setprecision(5)<<x1<<" "<<fixed<<setprecision(5)<<x2;
    }
    return 0;
}

 

4 tháng 7 2017

chỉ ctv hoặc giáo viên mới lm đc thôi! còn chọn đúng thì nhấn đúng là ok bn!

19 tháng 10 2025

Kh đọc dc chữ nào luôn🥰