Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
136858 冼俊烨 解一元三次方程 C++ 通过 100 0 MS 244 KB 312 2024-03-09 15:47:37

Tests(6/6):


#include<bits/stdc++.h> using namespace std; double a,b,c,d; int main(){ scanf("%lf%lf%lf%lf",&a,&b,&c,&d); // 输入 for(double i=-100;i<=100;i+=0.001){//枚举每个答案 if(fabs(i*i*i*a+i*i*b+i*c+d)<0.0001)//避免double精度错误 printf("%.02lf ",i);//两位小数输出 } return 0; }


测评信息: