#include <iostream> #include <iomanip> int main() { double price; int quantity; // 读取单价 std::cin >> price; // 读取数量 std::cin >> quantity; // 计算总金额 int total = static_cast<int>(price * quantity); // 输出结果,单价保留两位小数 std::cout << std::fixed << std::setprecision(2) << price << " " << quantity << " " << total << std::endl; return 0; } /************************************************************** Problem: 1703 User: panyuchen Language: C++ Result: Accepted Time:3 ms Memory:2072 kb ****************************************************************/