系统(“暂停”)未被识别 [英] system("pause") not recongnized

查看:94
本文介绍了系统(“暂停”)未被识别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用系统("暂停");暂停命令提示一会儿,突然暂停系统("暂停");不再工作

I have been using system("pause"); to pause command prompt for a while and all of a sudden the system("pause"); is not working anymore

我正在运行Visual Studio社区2017 - 15.6.4

I am running Visual Studio Community 2017 - 15.6.4

Windows 10教育

Windows 10 Education

64位操作系统

示例代码:

#include< iostream>

using namespace std;



int main(){

     //设定常数

     const double channelValue = 17.99;



     //创建变量

     int渠道;

    双倍费用;



     //输入的频道数量为
     cout<< "请输入频道数量:";
     cin>>频道;

     cout<<结束;



     //计算频道费用

     cost = channels * channelValue;



     //显示频道费用

     cout<< "所有频道的费用均为$"。 <<成本<<结束;



     //结束

     system("暂停");

    返回0;

}

#include <iostream>
using namespace std;

int main() {
    //set constant
    const double channelValue = 17.99;

    //create variables
    int channels;
    double cost;

    //input amount of channels
    cout << "Please enter the amount of channels: ";
    cin >> channels;
    cout << endl;

    //calculate the cost of the channels
    cost = channels * channelValue;

    //display the cost of the channels
    cout << "The cost of all your channels is $" << cost << endl;

    //end
    system("pause");
    return 0;
}

推荐答案

尝试添加
#include< process.h>


这篇关于系统(“暂停”)未被识别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆