«

防忽悠热线

点亮灯 发布于 阅读:92 C++


cwitch.rar

复制代码#include<iostream>
using namespace std;
int main()
{

//1、准备变量
int xuanze;

//2、录入数据

cout<<"\t***   这里是防忽悠热线   ***\t\n"<<endl;
cout<<"有人卖拐请按1"<<endl;
cout<<"有人卖车请按2"<<endl;
cout<<"有人讲脑筋急转弯请按3"<<endl;
cout<<"\n请输入您的选择:";
cin>>xuanze;

//3、4  计算判断,输出结果

    switch(xuanze)
    {

    case 1:
        cout<<"\n正在卖拐,请立即报警......"<<endl;
        break;
    case 2:
        cout<<"\n正在卖车,请立即报警......"<<endl;
        break;
    case 3:
        cout<<"\n正在讲脑筋急转弯,请立即报警......"<<endl;
        break;
    default:
        cout<<"\n您的拨打有误!"<<endl;
    }

}