代码如下所示,之前是用VS Code出现乱码,所以改完DOS系统下的编码方式,把VS Code的编码格式改成相同的之后,再运行程序,结果就会一闪而过,接着出现活动代码页,让按任意键继续。
#include "iostream"
using namespace std;
int main(int argc, char const *argv[])
{
double a, b, c, d;
cout << "Please Input The Number A:";
cin >> a;
cout << "Please Input The Number B:";
cin >> b;
cout << "Y = " << a << "X + " << b <<endl;
cout << "Please Input The Number Y:";
cin >> c;
d = (a + b) / c;
cout << "So X = " << d << endl;
system("pause");
return 0;
}
代码在VS Code中的运行效果如下:
当敲完回车后,程序显示的答案就直接闪过了,然后出现下面的图片:
各位有什么解决办法能只让显示程序最终的答案吗????