一个简单的switch
刚开始学,写了个简单的switch,当输入1时,结果输出“wrong number”,麻烦大家给看看include <iostream>
using namespace std;
int main()
{
int i;
cout<<"enter a number"<<endl;
cin>>i;
switch (i)
{
case 1:
{cout<<"case1";
break;}
case 2:
{cout<<"case2";
break;}
default:
{cout<<"wrong number";
break;}
}
}
[ 本帖最后由 denny001 于 2013-12-18 00:39 编辑 ]