#include<iostream>
using namespace std;
int main()
{
//if else与switch case 语句
//switch:判断条件只能是整形或者字符型,不能是一个区间,结构清晰,执行效率高
int ch = 0;
cout << "请输入ch" << endl;
cin >> ch;
switch (ch)
{
case 0:cout << "xian" << endl; break;
case 1:cout << "si" << endl; break;
default:cout << "fan" << endl; break;
}
system("pause");
return 0;
}
网友评论