在linux g++编译器中,不打印第三个数字,也不打印“reached”。但我预计会打印“到达”,然后它会进入无限循环。它使用代码块在 Windows 上按预期执行
#include <iostream>
int main()
{
int a;
for (int i = 0; i < 3; i++) {
std::cin >> a;
std::cout << a;
}
std::cout << "reached";
while (1) {}
return 0;
}