我在我的小熊猫C++中保存了下列代码
#include <iostream>
using namespace std;
int main ()
{
freopen ("data.txt","r",stdin);
freopen ("out.txt","w",stdout);
int n;
cin >> n;
for (int i = 1;i <= n;i ++)
{
int x;
cin >> x;
cout << x << ' ';
}
return 0;
}
其中,data.txt 为
5
1 2 3 4 5
out.txt 为
1 2 3 4 5
注释掉上述代码第六行,程序可正常输出 1 2 3 4 5,可是加上第六行之后程序不会输出,并显示

求问:这是怎么回事?