提交时间:2024-10-07 19:28:42
运行 ID: 52507
#include <iostream> #include <iomanip> int main() { int a, b; double result; std::cin >> a >> b; if (b == 0) { std::cerr << "Error: Division by zero is undefined." << std::endl; return 1; } result = static_cast<double>(a) / b / std::cout << std::fixed << std::setprecision(9); std::cout << result << std::endl; return 0; }