求方程的根,程序出现多余字符是什么情况?

求出的delta的值为0.为什么前面多了负号,两个根的结果后面多了#J是什么情况?
img

img

第14行,输入语句不用','号作为分隔,输入时敲空格键区分:
img
改为:

scanf("%f%f%f ",&a,&b,&c);

第15行:
img
改为如下,防止出现-0.000的情况:

disc = b * b - 4.0 * a * c + 1e-6;

这个代码
img


#include<bits/stdc++.h>
using namespace std;
int main()
{
    double a,b,c;
    cin>>a>>b>>c;
    double det=b*b-4*a*c;
    if(det<0) 
    {
        cout<<"无解";
        return 0;
    }
    double res1=(-1*b+sqrt(det))/(2*a);
    double res2=(-1*b-sqrt(det))/(2*a);
    
    
    cout<<setprecision(4)<<fixed<<res1<<endl;
    cout<<setprecision(4)<<fixed<<res2<<endl;
    
}