本帖最後由 劉泳鱔 於 2013-6-30 21:36 編輯
- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int p, q, price;
- cout<<"╴▁▂▃▅神麼都有店▅▃▂▁╴"<<endl;
- cout<<"$$商品價目表$$"<<endl;
- cout<<"(1)以諾牙刷 450元/t"<<endl;
- cout<<"(2)以諾手指 550元/t"<<endl;
- cout<<"(3)人頭○ 325元/t/t"<<endl;
- cout<<"(4)四肢↖↗↘↙ 200元/t/t"<<endl;
- cout<<"(5)以諾方程式(x+a)^n=?_(k=0)^n??(n?k) x^k a^(n-k) ? 3000元/t"<<endl;
- cout<<"(6)奴隸(一個月) 150元/t"<<endl;
- cout<<"(7)林以諾 0元/t/t"<<endl;
- cout<<"[使用規則]"<<endl;
- cout<<"依序輸入想購買的商品與數量,如林以諾兩隻請輸入'7 2'<<endl;"<<endl;
- cout<<"選購完畢時輸入'8 8'進入結帳頁"<<endl;
- start:
- cout<<"在此輸入: ";
- cin>>p>>q
- if(p>=1 && p<=7 && q>0)
- {
- sum=sum+price[p-1]*q
- goto start;
- }else if(p==8 && q==8)
- {
- goto checkout;
- }else
- {
- cout<<"輸入錯誤"<<endl;
- goto start;
- }
- system("pause");
- return 0;
- }
複製代碼 |