gpt4 book ai didi

c++ - C++ 的 Cin.get() 问题

转载 作者:行者123 更新时间:2023-11-30 04:09:49 24 4
gpt4 key购买 nike

<分区>

我仍然不知道这在 Visual Studio 中是如何工作的。

据说它可以让我的控制台保持打开状态,但事实并非如此。它仍然闪烁并关闭。我做错了什么吗?

#include <iostream>
using namespace std;

int main()
{
int a;
cout << "Please enter an integer: ";
cin >> a;

if (a == 1)
{
cout << endl << "You typed 1.";
}
else
cout << "That's not 1.";

cin.get();

return 0;
}

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com