以下是使用 C++ 解决此问题的代码: ```cpp #include <iostream> #include <iomanip> // 用于格式化输出 int main() { double num1; int num2; char ch; double num3; std::cin >> num1 >> num2 >> ch >> num3; std::cout << ch << " " << num2 << " " << std::fixed << std::setprecision(2) << num1 << " " << std::fixed << std::setprecision(2) << num3 << std::endl; return 0; } ``` 在上述代码中,我们使用 `std::cin` 进行输入,使用 `std::fixed` 和 `std::setprecision(2)` 来设置浮点数的输出格式,保留两位小数。 [2024-10-16 14:31:08 | AI写代码神器 | 187点数解答]