#include "iostream"
using namespace std;
int main(int argc, char const *argv[])
{
int n=100000;
int cost=6;
for (int i = 1; i <= n; ++i)
{
cout<<cost<<endl;
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
编译并运行在ideone.com上的上述程序(使用SPOJ编译器的在线g ++编译器)会产生运行时错误.当cout注释掉该行时,程序将成功运行.有人能指出相同的原因吗?