本帖最後由 謝瀞儀 於 2015-3-14 14:27 編輯
- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int thing, number,sum=0;
- string name[21]={"V家七宗罪系列(包含序號2~9)","湯匙(齒輪) ",
- "酒杯 ",
- "劍 ",
- "金鑰匙 ",
- "人偶 ",
- "四面鏡 ",
- "禍世之剪 ",
- "上了發條的搖籃曲 ",
- "白癡藥水 ",
- "生鏽的齒輪人偶 ",
- "受詛咒之雙刃(附皮革套)",
- "跳針的古老大鐘 ",
- "失憶藥丸 ",
- "座敷童子的靈棺 ",
- "淌血的附喪神人偶 ",
- "會咬人的蜘蛛玩偶 ",
- "梅杜莎的頭顱 ",
- "巫婆熬藥的大鍋 ",
- "活生生殭屍殺人魔/吸血鬼 "};
- long money[21]={1200,70,80,80,100,120,150,100,350,
- 70,80,20,1300,130,700,130,120,500,1000,10000};
- cout<<"XXX崩壞/中二玩具精品店XXX"<<endl;
- cout<<"這裡的壞掉商品包山包海,應有盡有,等你來搜刮!"<<endl;
- cout<<"本店絕對沒有惡意哄抬價格,也絕對沒有低價購入,高價賣出的不良嗜好,敬請安心"<<endl;
- cout<<"對於購買商品的問題,出事本店一概不負責"<<endl;
- cout<<"--------------------------------------------------------------------------"<<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;
-
- }
- else
- {
- cout<<"奧客去死辣!本店將會詛咒你的餘生(甩門)"<<endl;
- }
- goto re;
- checkout:
-
- cout<<"共"<<sum<<"萬元"<<endl;
- system("pause");
- return 0;
- }
複製代碼 |