繁体   English   中英

每个程序上的“登出”字样

[英]“logout” word on every program

当我编写每个C ++程序时,例如:

#include <iostream>
#include <string>

using namespace std;

int main()
{
    int n;
    cout << "Tell me where to start: ";
    cin >> n;
    while (n>0) {
        cout << n << "\n";
        n = n-1;
    }
    cout << "FIRE!";
    return 0;
}

我用G ++编译它,当我运行它时,它运行良好,但是当它完成时,它在程序的最后一个单词之后显示“注销”单词,如下所示:

Tell me where to start: 10
10
9
8
7
6
5
4
3
2
1
FIRE!logout

[Process completed]

为什么? 我该如何删除它?

它不是来自您的程序。 这是因为打开终端是出于运行程序的唯一目的,因此退出终端时,终端会关闭。

如果您打开外壳程序并手动运行可执行文件,而不是显示此消息,您将仅得到另一个命令提示符。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM