你没写循环结束条件,即:没写for语句的第二个表达式,无限循环了
#include <iostream> int main() { int a, b; while (std::cin >> a >> b) std::cout << a + b << '\n'; return 0; }