#include <iostream> int getValueFromUser() { std::cout << "请输入一个数字: " << std::endl; int a; std::cin >> a; return a; } int main() { int x = getValueFromUser(); int y = getValueFromUser(); std::cout << x << " + " << y << " = " << x + y << std::endl; return 0; }
时间: 2024-10-09 23:11:53