本帖最後由 謝瀞儀 於 2015-4-21 19:41 編輯
- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- re2:
- int thing, number,sum=0,option,pay,price,money1;
- string name[21]={"V家七宗罪系列(包含序號2~9)",
- "湯匙(齒輪) ",
- "酒杯 ",
- "劍 ",
- "金鑰匙 ",
- "人偶 ",
- "四面鏡 ",
- "禍世之剪 ",
- "上了發條的搖籃曲 ",
- "白癡藥水 ",
- "生鏽的齒輪人偶 ",
- "受詛咒之雙刃(附皮革套) ",
- "跳針的古老大鐘 ",
- "失憶藥丸 ",
- "座敷童子的靈棺 ",
- "淌血的附喪神人偶 ",
- "會咬人的蜘蛛玩偶 ",
- "梅杜莎的頭顱 ",
- "巫婆熬藥的大鍋 ",
- "活生生殭屍殺人魔/吸血鬼 "};
- int money[21]={1200,70,80,80,100,120,150,100,350,70,80,20,1300,130,700,130,120,500,1000,10000};
- int qty[21]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
- cout<<"XXX崩壞/中二玩具精品店XXX"<<endl;
- cout<<"這裡的壞掉商品包山包海,應有盡有,等你來搜刮!"<<endl;
- cout<<"本店絕對沒有惡意哄抬價格,也絕對沒有低價購入,高價賣出的不良嗜好,敬請安心"<<endl;
- cout<<"對於購買商品的問題,出事本店一概不負責"<<endl;
- cout<<"--------------------------------------------------------------------------"<<endl;
- cout<<endl<<endl<<"[促銷方案]"<<endl;
- cout<<"消費滿500萬送半張衛生紙乙份"<<endl
- <<"消費滿700萬送一元折價卷乙本(每本50張,不得於當次使用,一次來店限用一張)"<<endl
- <<"消費滿1000萬送食人菜瓜布乙份+夏語遙代言?將碗盤洗的超乾淨牌洗碗精?乙份"<<endl
- <<"加一百萬升級食魔菜瓜布乙份+夏語遙代言?將魔物洗的超乾淨牌洗碗精?乙份"<<endl
- <<"消費滿1億送食魔菜瓜布乙份+夏語遙代言?將魔物洗的超乾淨牌洗碗精?乙份"<<endl
- <<endl;
- int i=0;
- while(i<20)
- {
- cout<<"("<<i+1<<")"<<name[i]<<"\t"<<money[i]<<"萬元"<<endl;
- i++;
- }
- cout<<"(21)結帳"<<endl;
- re:
- cout<<"請輸入商品代號: "<<endl;
- cin>>thing;
- if(thing==21)
- {
- goto checkout;
- }
- else if(thing>0 && thing<21)
- {
- cout<<"數量: "<<endl;
- cin>>number;
- if(number<=0)
- {
- cout<<"奧客去死辣!本店將會詛咒你的餘生(甩門)"<<endl;
- goto re;
- }
- sum+=money[thing-1]*number;
- qty[thing-1]+=number;
- }
- else
- {
- cout<<"奧客去死辣!本店將會詛咒你的餘生(甩門)"<<endl;
- }
- goto re;
- checkout:
- cout<<endl<<"中二精品購物清單"<<"\a"<<endl;
- cout<<"------------------------------"<<"\n";
- for(int i=0;i<21;i++)
- {
- if(qty[i]!=0)
- {
- cout<<name[i]<<"\t"<<money[i]<<"元 * "<<qty[i]<<"個"<<endl;
- }
- }
- cout<<"------------------------------"<<"\n";
- if(sum==0)
- {
- cout<<"0元"<<endl;
- }
- else
- {
- cout<<"共"<<sum<<"萬元"<<endl;
- if(sum>500 && sum<700)
- {
- cout<<"[促銷方案] 滿500萬送半張衛生紙乙份"<<endl<<endl;
- }
- else if(sum>700 && sum<1000)
- {
- cout<<"[促銷方案] 滿700萬送一元折價卷乙本"
- "(每本50張,不得於當次使用,一次來店限用一張)";
- }
- else if(sum>1000 && sum<10000)
- {
- cout<<"[促銷方案] 滿1000萬送食人菜瓜布乙份"
- "+夏語遙代言?將碗盤洗的超乾淨牌洗碗精?乙份";
- cout<<"是否要加100萬升級食魔菜瓜布乙份"
- "+夏語遙代言?將魔物洗的超乾淨牌洗碗精?乙份"<<endl;
- cout<<"1-是 2-否 ";
- cin>>option;
- if(option==1)
- {
- sum+=100;
- }
- else
- {
- goto choice;
- }
- }
- else if(sum>=10000)
- {
- cout<<"[促銷方案] 滿1億送食魔菜瓜布乙份"
- "+夏語遙代言?將魔物洗的超乾淨牌洗碗精?乙份"<<endl;
- }
- choice:
- cout<<"1-正確 2-錯誤,重選"<<endl;
- cin>>option;
- if(option==1)
- {
- goto change;
- }
- else
- {
- system("cls");
- goto re2;
- }
- change:
- cout<<"請付錢(萬元) "<<endl;
- cin>>pay;
- money1=pay-sum;
- if(money1==0)
- {
- cout<<"錢嘟嘟好"<<endl;
- }
- else if(money1<0)
- {
- cout<<"錢不夠,老子詛咒你永世不得超生"<<endl;
- goto change;
- }
- else
- {
- cout<<"找您"<<money1<<"萬元"<<endl;
- if(money1>=2000)
- {
- cout<<"二千元鈔票"<<money1/2000<<"萬將"<<endl;
- money1%=2000;
- }
- if(money1>=1000)
- {
- cout<<"一千元鈔票"<<money1/1000<<"萬將"<<endl;
- money1%=1000;
- }
- if(money1>=500)
- {
- cout<<"五百元鈔票"<<money1/500<<"萬將"<<endl;
- money1%=500;
- }
- if(money1>=200)
- {
- cout<<"二百元鈔票"<<money1/200<<"萬將"<<endl;
- money1%=200;
- }
- if(money1>=100)
- {
- cout<<"一百元鈔票"<<money1/100<<"萬將"<<endl;
- money1%=100;
- }
- if(money1>=50)
- {
- cout<<"五十元硬幣"<<money1/50<<"萬個"<<endl;
- money1%=50;
- } if(money1>=20)
- {
- cout<<"二十元硬幣"<<money1/20<<"萬個"<<endl;
- money1%=20;
- } if(money1>=10)
- {
- cout<<"十元硬幣"<<money1/10<<"萬個"<<endl;
- money1%=10;
- }
- if(money1>=5)
- {
- cout<<"五元硬幣"<<money1/5<<"萬個"<<endl;
- money1%=5;
- }
- if(money1>0)
- {
- cout<<"一元硬幣"<<money1<<"萬個"<<endl;
- }
- cout<<endl<<"中二精品玩具店謝謝您的惠顧"<<endl
- <<"再重申一次,對於購買商品的問題,"
- <<"出事本店一概不負責,感謝您的光臨!!"<<endl;
-
- }
- }
-
- system("pause");
- return 0;
- }
複製代碼 |