c++基础(7)

来源:互联网 发布:支付宝和淘宝怎么解绑 编辑:程序博客网 时间:2024/06/05 17:16
#include <iostream>using namespace  std;int main(){       int x;    cout << "enter a number:\n";    cin >> x;    switch (x) {        case 1:        case 2:        case 3:        cout << "x is 1, 2 or 3."<<endl;        break;        default:        cout << "x is not 1, 2, or 3!"<<endl;    }    return 0;}
原创粉丝点击