C++编程练习

#include<iostream.h>
int main()
{int which;
which=0;
cout<<"1-new"<<endl;
cout<<"2-open"<<endl;
cout<<"0-quit"<<endl;
cout<<"your choice:"<<endl;
cin>>which;
switch(which)
{case 1:
cout<<"新建"<<endl;
break;
case 2:
 cout<<"打开"<<endl;
 break;
case 0:
 cout<<"关闭"<<endl;
 break;
defaut:
 cout<<"出错"<<endl;
}
return 0;
}

猜你喜欢

转载自blog.csdn.net/singularityfisher/article/details/81149663