#includeint 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;}
本文共 340 字,大约阅读时间需要 1 分钟。
#includeint 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;}
转载于:https://www.cnblogs.com/funnyweb/p/6215796.html