Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
80640 sh25_wangtaojie 加法运算(指针) C++ 通过 0 MS 240 KB 489 2026-01-04 15:25:16

Tests(1/1):


#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; }


测评信息: