去除VC6.0输出时显示的输入和最后的press那句话

去除VC6.0输出时显示的输入和最后的press any key to continue

img

img

img

以下内容部分参考ChatGPT模型:


要去除VC6.0输出时显示的输入和最后的press any key to continue,可以在代码中加入以下语句:

system("color 07"); //将控制台的前景色和背景色都设置为白色
system("cls"); //清屏

这样就可以清除掉输入和输出的内容,同时也避免了显示press any key to continue这句话。以下是完整的示例代码:

#include <stdio.h>
#include <stdlib.h>

int main()
{
    system("color 07");
    system("cls");
    printf("Hello World!\n");
    return 0;
}

如果我的建议对您有帮助、请点击采纳、祝您生活愉快

把printf去掉,就没有提示了
至于press any key to continue...
这个没必要去掉,实际运行(双击exe运行)是没有的