在VS2019上运行while,for循环会莫名报错,这是VS2019的问题吗?

这个循环在VS2019上一直运行不正常,但是在DevC++上可以正常运行。
我很疑惑是VS自身的问题吗???

#include

using namespace std;

int main()
{
int number;
int n, N, i;
cin >> number >> N;
for (i = 1; i <= N;i++)
{
cin >> n;
if (n < 0)
{
cout << "Game Over" << endl;
return 0;
}
if (n > number && n > 0 && i <= N)
{
cout << "Too big" << endl;
}
if (n < number && n>0 && i <= N)
{
cout << "Too small" << endl;
}
if (n == number && i == 1)
{
cout << "Bingo!" << endl;
return 0;
}
if (n == number && i > 1 && i <= 3)
{
cout << "Lucky You!" << endl;
return 0;
}
if (n == number && i > 3)
{
cout << "Good Guess!" << endl;
return 0;
}

}
if (i > N)
{
    cout << "Game Over" << endl;
    return 0;
}
return 0;

}

https://blog.csdn.net/weixin_44599681/article/details/101950291