头文件<iomanip>输出浮点数的精度; #include<iostream> #include<iomanip> using namespace std; int main() { double a,b; cin>>a>>b; cout << "MEDIA = " << fixed << setprecision(5) << (a * 3.5 + b * 7.5 ) / 11 << endl; return 0; }