7 solutions
-
-1
- 1
Information
- ID
- 498
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 2
- Tags
- # Submissions
- 92
- Accepted
- 59
- Uploaded By
标准答案,可以抄袭: #include #include using namespace std;
int main() { double a, b, c, d, x; cin >> x >> a >> b >> c >> d; double mul = a * x * x * x + b * x * x + c * x + d; cout << fixed << setprecision(7) << mul << endl; return 0; }
#include <iostream>
using namespace std;
int main()
{
double a, b, c, d, x;
cin >> x >> a >> b >> c >> d;
cout << fixed << setprecision(7) << a * x * x * x + b * x * x + c * x + d << endl;
return 0;
}
9行
//10行代码,完美解决
#include<iostream>
#include<iomanip>
using namespace std;
double a,b,c,d,x,s=0;
int main(){
cin>>x>>a>>b>>c>>d;
s=a*x*x*x+b*x*x+c*x+d;
cout<<fixed<<setprecision(7)<<s;
return 0;
}
//you can copy it
#include #include using namespace std; int main(){ double a,b,c,d,x,y; cin>>x>>a>>b>>c>>d; y=axxx+bxx+cx+d; cout<<fixed<<setprecision(7)<<y; return 0; }
题解 #include
using namespace std; int main(){ double a , b , c , d , x , l; cin >> x >> a >> b >> c >> d; l = a * x * x * x + b * x * x + c * x + d; printf("%.7f" , l); return 0; }
#include<iostream>
#include<iomanip>
using namespace std;
long double f(long double x,
long double a,long double b,
long double c,long double d){
return a*x*x*x+b*x*x+c*x+d;
}
int main(){
long double a,b,c,d,x;
cin>>x>>a>>b>>c>>d;
cout<<setprecision(7)<<fixed<<f(x,a,b,c,d);
}
By signing up a ZXOJ universal account, you can submit code and join discussions in all online judging services provided by us.