#include<conio.h>
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
double pj=0;
int xj=0;
int sh[13],sss=1000000000,jian[13]={0,100,250,210,160,140,250,310,500,720,220,80,380};
int jia[13]={140,140,300,250,220,160,350,320,560,810,260,90,450};
string ch[13]={"","培根","汉堡","鸡尾酒","猪肉","胡萝卜","薯条","鱼","鸡翅","披萨","水果","卫龙辣条","意面"};
string name;
int main(){
cout<<"申请餐厅名字:";
cin>>name;
system("cls");
cout<<"申请成功!";
getch();
srand(time(NULL));
while(1){
s: system("cls");
printf("你有%d元\n",sss);//66
xj=pj/10;
cout<<"餐厅评价:"<<pj<<"分\n";
printf("餐厅星级:%d星\n",xj);
int t=66-name.length()-4;
if(t%2==0){
for(int i=1;i<=t/2;i++)
cout<<"-";
cout<<name<<"餐厅";
for(int i=1;i<=t/2;i++)
cout<<"-";
}else{
for(int i=1;i<=t/2;i++)
cout<<"-";
cout<<name<<"餐厅";
for(int i=1;i<=t/2+1;i++)
cout<<"-";
}
cout<<endl;
printf("1.培根 数量: %d条。 2.汉堡 数量: %d个。 3.鸡尾酒 数量: %d瓶。\n",sh[1],sh[2],sh[3]);
printf("价格: 140元。 价格: 300元。 价格: 250元。\n\n");Sleep(250);
printf("4.猪肉 数量: %d份。 5.胡萝卜 数量: %d个。 6.薯条 数量: %d份。\n",sh[4],sh[5],sh[6]);
printf("价格: 220元。 价格: 160元。 价格: 350元。\n\n");Sleep(250);
printf("7.鱼 数量: %d条。 8.鸡翅 数量: %d份。 9.披萨 数量: %d个。\n",sh[7],sh[8],sh[9]);
printf("价格: 320元。 价格: 560元 价格: 810元。\n\n");Sleep(250);
printf("10.水果 数量: %d条。 11.卫龙辣条 数量: %d个。 12.意面 数量: %d瓶。\n",sh[10],sh[11],sh[12]);
printf("价格: 260元。 价格: 90元。 价格: 450元。\n\n输入(g:进货,s:营业,t:退游):\n");Sleep(10);
char c=getch();
if(c=='g')
while(1){
if(sss<80)goto s;
system("cls");
printf("你有%d元\n",sss);
xj=pj/10;
cout<<"餐厅评价:"<<pj<<"分\n";
printf("餐厅星级:%d星\n",xj);
int t=66-name.length()-4;
if(t%2==0){
for(int i=1;i<=t/2;i++)
cout<<"-";
cout<<name<<"餐厅";
for(int i=1;i<=t/2;i++)
cout<<"-";
}else{
for(int i=1;i<=t/2;i++)
cout<<"-";
cout<<name<<"餐厅";
for(int i=1;i<=t/2+1;i++)
cout<<"-";
}
cout<<endl;
printf("1.培根 数量: %d条。 2.汉堡 数量: %d个。 3.鸡尾酒 数量: %d瓶。\n",sh[1],sh[2],sh[3]);
printf("价格: 100元。 价格: 250元。 价格: 210元。\n\n");Sleep(250);
printf("4.猪肉 数量: %d份。 5.胡萝卜 数量: %d个。 6.薯条 数量: %d份。\n",sh[4],sh[5],sh[6]);
printf("价格: 160元。 价格: 140元。 价格: 250元。\n\n");Sleep(250);
printf("7.鱼 数量: %d条。 8.鸡翅 数量: %d份。 9.披萨 数量: %d个。\n",sh[7],sh[8],sh[9]);
printf("价格: 310元。 价格: 500元 价格: 720元。\n\n");Sleep(250);
printf("10.水果 数量: %d条。 11.卫龙辣条 数量: %d个。 12.意面 数量: %d瓶。\n",sh[10],sh[11],sh[12]);
printf("价格: 220元。 价格: 80元。 价格: 380元。\n\n输入进货产品:\n");Sleep(10);
printf("13.退出\n");Sleep(100);
int cu;scanf("%d",&cu);if(cu==13)break;
printf("数量:\n");int ca;scanf("%d",&ca);bool f=1;
for(int i=1;i<13;i++)
if(i==cu&&sss-ca*jian[i]>=0){sh[i]+=ca,sss-=ca*jian[i],f=0;printf("成功!");Sleep(1000);break;}
else if(i==cu&&sss-ca*jian[i]<0){printf("钱不够\n");f=0;break;}
if(f)goto s;
}
else if(c=='s'){
int h=10;
while(h--){
char s;
int iif=rand()%8;
system("cls");
printf("你有%d元\n",sss);
xj=pj/10;
cout<<"餐厅评价:"<<pj<<"分\n";
printf("餐厅星级:%d星\n",xj);
int t=66-name.length()-4;
if(t%2==0){
for(int i=1;i<=t/2;i++)
cout<<"-";
cout<<name<<"餐厅";
for(int i=1;i<=t/2;i++)
cout<<"-";
}else{
for(int i=1;i<=t/2;i++)
cout<<"-";
cout<<name<<"餐厅";
for(int i=1;i<=t/2+1;i++)
cout<<"-";
}
cout<<endl;
printf("1.培根 数量: %d条。 2.汉堡 数量: %d个。 3.鸡尾酒 数量: %d瓶。\n",sh[1],sh[2],sh[3]);
printf("价格: 140元。 价格: 300元。 价格: 250元。\n\n");Sleep(250);
printf("4.猪肉 数量: %d份。 5.胡萝卜 数量: %d个。 6.薯条 数量: %d份。\n",sh[4],sh[5],sh[6]);
printf("价格: 220元。 价格: 160元。 价格: 350元。\n\n");Sleep(250);
printf("7.鱼 数量: %d条。 8.鸡翅 数量: %d份。 9.披萨 数量: %d个。\n",sh[7],sh[8],sh[9]);
printf("价格: 320元。 价格: 560元 价格: 810元。\n\n");Sleep(250);
printf("10.水果 数量: %d条。 11.卫龙辣条 数量: %d个。 12.意面 数量: %d瓶。\n",sh[10],sh[11],sh[12]);
printf("价格: 260元。 价格: 90元。 价格: 450元。\n\n事件:\n");Sleep(10);
if(iif==0){printf("今天因门外火灾,提早关店,店员各自逃生。\n");Sleep(2000);while(true){system("start calc");system("start https://www.luogu.com.cn");}break;}
else if(iif==1||iif==2){
time_t curtime;
time(&curtime);
printf("%s",ctime(&curtime));
printf("肯德基要买");
int a[4][3]={0,0,0,0,rand()%12+1,rand()%3+1,0,rand()%12+1,rand()%3+1,0,rand()%12+1,rand()%3+1};
while(1){
if(a[1][1]!=a[2][1]&&a[2][1]!=a[3][1]&&a[3][1]!=a[1][1])break;
if(a[1][1]==a[2][1])a[2][1]=rand()%12+1;
if(a[1][1]=a[3][1])a[3][1]=rand()%12+1;
if(a[2][1]==a[3][1])a[3][1]=rand()%12+1;
}
cout<<ch[a[1][1]]<<a[1][2]<<"个,"<<ch[a[2][1]]<<a[2][2]<<"个,"<<ch[a[3][1]]<<a[3][2]<<"个。"<<endl;
cout<<"(输入1.有货 or 2.没货):";
s=getch();
if(s=='1'){
if(sh[a[1][1]]<a[1][2]||sh[a[2][1]]<a[2][2]||sh[a[3][1]]<a[3][2]){printf("没货了!!!\n");Sleep(2001);continue;}
bool f=0;int sum=0;
for(int i=1;i<13;i++){
if(i==a[1][1])sum+=a[1][2]*jia[i],sh[i]-=a[1][2];
else if(i==a[2][1])sum+=a[2][2]*jia[i],sh[i]-=a[2][2];
else if(i==a[3][1])sum+=a[3][2]*jia[i],sh[i]-=a[3][2];
}
sss+=sum;
pj+=sum/100;
}else pj-=0.5;
}
else if(iif==2||iif==3||iif==4){
time_t curtime;
time(&curtime);
printf("%s",ctime(&curtime));
printf("波斯顿上将要买");
int a[3][3]={0,0,0,0,rand()%12+1,rand()%3+1,0,rand()%12+1,rand()%3+1};
while(1){
if(a[1][1]!=a[2][1])break;
if(a[1][1]==a[2][1])a[2][1]=rand()%12+1;
}
cout<<ch[a[1][1]]<<a[1][2]<<"个,"<<ch[a[2][1]]<<a[2][2]<<"个。";
cout<<"(输入1.有货 or 2.没货):";
s=getch();
if(s=='1'){
if(sh[a[1][1]]<a[1][2]||sh[a[2][1]]<a[2][2]){printf("没货了!!!\n");Sleep(2001);continue;}
bool f=0;int sum=0;
for(int i=1;i<13;i++){
if(i==a[1][1])sum+=a[1][2]*jia[i],sh[i]-=a[1][2];
else if(i==a[2][1])sum+=a[2][2]*jia[i],sh[i]-=a[2][2];
}
sss+=sum;
pj+=sum/100;
}else pj-=0.5;
}
else if(iif==5||iif==6){
time_t curtime;
time(&curtime);
printf("%s",ctime(&curtime));
printf("诚享传奇的大佬要买");
int a[2][3]={0,0,0,0,rand()%12+1,rand()%3+1};
cout<<ch[a[1][1]]<<a[1][2]<<"个。";
cout<<"(输入1.有货 or 2.没货):";
s=getch();
if(s=='1'){
if(sh[a[1][1]]<a[1][2]){printf("没货了!!!\n");Sleep(2001);continue;}
bool f=0;int sum=0;
for(int i=1;i<13;i++)
if(i==a[1][1])sum+=a[1][2]*jia[i],sh[i]-=a[1][2];
sss+=sum;
pj+=sum/100;
}else pj-=0.5;
}
else{
time_t curtime;
time(&curtime);
printf("%s",ctime(&curtime));
printf("你邻居要买");
int a[2][3]={0,0,0,0,rand()%12+1,rand()%3+1};
cout<<ch[a[1][1]]<<a[1][2]<<"个。";
cout<<"(输入1.有货 or 2.没货):";
s=getch();
if(s=='1'){
if(sh[a[1][1]]<a[1][2]){printf("没货了!!!\n");Sleep(2001);continue;}
bool f=0;int sum=0;
for(int i=1;i<13;i++)
if(i==a[1][1])sum+=a[1][2]*jia[i],sh[i]-=a[1][2];
sss+=sum;
pj+=sum/100;
}else pj-=0.5;
}
}
system("cls");int ti=(rand()%70+1)/10*10;sss-=ti;
printf("今天国家收税%d元\n",ti);Sleep(251);
printf("今天营业结束,明天再来!\n");system("pause");
}
else if(c=='t')break;
/* else if(c='f'){
int a;
printf("输入a:");cin>>a;
if(a==20061013){
printf("外挂生效!"),Sleep(1009),sss+=1000000;
for(int i=1;i<13;i++)sh[i]+=150
},f:请求外挂
}*/
}
printf("谢谢!\n");
return 0;
}