返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     string name[7]={"球","球","球","球","球","球","球"};
  7.     int price[7]={0,0,0,0,0,0,0};
  8.     cout<<"  ☆★★洪翊庭大帥哥店☆☆★ "<<endl<<endl;
  9.      
  10.    
  11.    
  12.     for(int i=0; i<7; i++)
  13.     {
  14.             cout<<"("<<i+1<<")"<<name[i]<<"\t"<<price[i]<<"元"<<endl;
  15.             }
  16.                 system("pause");
  17.                         return 0;
  18. }      
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.      re:
  7.           system("cls");
  8.     string name[8]={"球","球","球","球","球","球","球","結帳"};
  9.     int price[7]={0,0,0,0,0,0,0};
  10.     cout<<"  ☆★★洪翊庭大帥哥店☆☆★ "<<endl<<endl;   
  11.     for(int i=0; i<8; i++)
  12.     {
  13.             cout<<"("<<i+1<<")"<<name[i]<<"\t"<<price[i]<<"元"<<endl;
  14.             }
  15.              cout<<"(8)結帳"<<endl<<endl;
  16.              re2:
  17.            cout<<"請輸入商品代碼"<<endl;
  18.            cin>>p;
  19.            if(p==8)
  20.            {
  21.                    goto checkout;
  22.                    }else if(p>=%%p<=7)
  23.                    {
  24.                          cout<<"數量"<<endl;
  25.                 system("pause");
  26.                 goto re;
  27.                         return 0;
  28. }      
複製代碼

TOP

返回列表