哪个高手,能帮我编一个菜单用while循环的
谢谢
程序代码:
// Note:Your choice is C++ IDE #include <iostream> using namespace std; void help() { cout<<"- - - 帮助信息 - - -"<<endl; cout<<"1:input"<<endl; //具体功能可以自己写函数 cout<<"2:output"<<endl; cout<<"3:clearscreen"<<endl; cout<<"4:helpinfo"<<endl; cout<<"5:exit"<<endl; } int main() { system("color 2"); help(); while(1) { char c; cout<<'>'; cin>>c; switch(c) { case '1': { cout<<"input"<<endl; } break; case '2': { cout<<"output"<<endl; }break; case '3': { system("cls"); } break; case '4': { help(); } break; case '5': { exit (0); } break; default: { cout<<"no such cmd!"<<endl; } break; } } return 0; }