提交时间:2026-01-04 15:25:16

运行 ID: 80640

#include <iostream> using namespace std; // GetTwoInts函数声明,通过指针参数返回两个整数 void GetTwoInts(int* a, int* b); int main() { int num1, num2; // 调用GetTwoInts函数获取两个整数 GetTwoInts(&num1, &num2); // 计算并输出两数之和 cout << num1 + num2 << endl; return 0; } // GetTwoInts函数实现,从键盘读入两个整数 void GetTwoInts(int* a, int* b) { cin >> *a >> *b; }