#include <iostream>
#include <string>
#include <conio.h> // 注意:这仅在Windows中有效
#include <windows.h>
#include <cstdlib>
#include <ctime>
#include <iomanip>
using namespace std;
int main(){
while(true){
float money;
int k1,k2,k3,k4,k5,k6,k7,k8,k9;
cout<<" ____________________________________________"<<endl;
cout<<"| KFC |"<<endl;
cout<<"|点餐系统1.0 |"<<endl;
cout<<"| 饮料: |"<<endl;
cout<<"| #.可乐 Z 12元 X |"<<endl;
cout<<"| #.雪碧 C 12元 V |"<<endl;
cout<<"| 小食: |"<<endl;
cout<<"| #.薯条 大 K 10元 J |"<<endl;
cout<<"| #.蛋挞 1加入购物车+1 q 5元 |"<<endl;
cout<<"| 汉堡: |"<<endl;
cout<<"| #.麦辣鸡腿堡 19.9元 F 限时秒杀 G |"<<endl;
cout<<"| #.鳕鱼堡 O 16元 P |"<<endl;
cout<<"| 套餐: |"<<endl;
cout<<"| #.1早饭(米粥+鸡蛋堡+沙拉)22元 R加入购物车|"<<endl;
cout<<"| #.2午饭(牛肉堡+蔬菜汤+雪碧)42元 T |"<<endl;
cout<<"| #.3晚饭(鳕鱼堡(单)+土豆泥+拉丝芝士 30元Y |"<<endl;
cout<<"|套餐不可以取消 |"<<endl;
cout<<"|____________________________________________|"<<endl;
while (!_kbhit()) {
}
char input = _getch();
switch(input){
case 'z':
cout<<"12+"<<endl;
money+=12;
k1++;
system("cls");
break;
case 'c':
cout<<"12+"<<endl;
system("cls");
money+=12;
k2++;
break;
case'k':
cout<<"10+"<<endl;
system("cls");
money+=10;
k3++;
break;
case'1':
cout<<"5+"<<endl;
system("cls");
money+=5;
k4++;
break;
case'f':
cout<<"19.9"<<endl;
system("cls");
money+=19.9;
k5++;
break;
case'o':
cout<<"16+"<<endl;
system("cls");
money+=16;
k6++;
break;
case'r':
cout<<"22+"<<endl;
system("cls");
money+=22;
k7++;
break;
case't':
cout<<"42+"<<endl;
system("cls");
money+=42;
k8++;
break;
case'y':
cout<<"30+"<<endl;
system("cls");
money+=30;
k9++;
break;
case'm':
system("cls");
cout<<"付钱:"<<money<<endl;
Sleep(2000);
cout<<"支付成功"<<endl;
//return 0;
}
system("cls");
}
}