- //实现点菜功能
- //如何把点的多有菜存储起来?
- #include<stdio.h>
- int main(){
- int cai;
- while(1){
- printf("亲,请点菜哦!需要退出菜单请输入11\n0鱼香肉丝\t1冬瓜炖肉\n2香辣鸡块\t3咖喱土豆\n4番茄炒蛋\t5红焖羊肉\n6凉拌黄瓜\t7酸辣土豆\n8紫菜蛋汤\t9米饭一碗\n");
- scanf("%d",&cai);
- if (cai>11||cai<0) {
- printf("亲,你输错了哦!请看清楚序号哦!\n");
- }
- switch (cai) {
- case 0:
- printf("恭喜你,你点的*鱼香肉丝**已经传达给大厨\n");
- break;
- case 1:
- printf("恭喜你,你点的*冬瓜炖肉**已经传达给大厨\n");
- break;
- case 2:
- printf("恭喜你,你点的*香辣鸡块**已经传达给大厨\n");
- break;
- case 3:
- printf("恭喜你,你点的*咖喱土豆**已经传达给大厨\n");
- break;
- case 4:
- printf("恭喜你,你点的*番茄炒蛋**已经传达给大厨\n");
- break;
- case 5:
- printf("恭喜你,你点的*红焖羊肉**已经传达给大厨\n");
- break;
- case 6:
- printf("恭喜你,你点的*凉拌黄瓜**已经传达给大厨\n");
- break;
- case 7:
- printf("恭喜你,你点的*酸辣土豆**已经传达给大厨\n");
- break;
- case 8:
- printf("恭喜你,你点的*紫菜蛋汤**已经传达给大厨\n");
- break;
- case 9:
- printf("恭喜你,你点的*米饭一碗**已经传达给大厨\n");
- break;
- case 11:
- return 0;
- default:
- break;
- }
- }
- return 0;
- }
复制代码 |
|