Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
4151 测试1 A+B 输入输出练习III C++ Accepted 1 MS 264 KB 430 2024-08-12 00:57:51

Tests(1/1):


Code:

#include <iostream> using namespace std; int main() { int a, b; while (true) { // 使用true作为循环条件,与while(1)等价但更明确 cin >> a >> b; if (a == 0 && b == 0) { break; // 当输入为0 0时,退出循环 } cout << a + b << endl; // 否则,输出a和b的和,并换行 } return 0; // 程序正常结束 }