#26604: 最後Total:有空格


10931463@gafe.cksh.tp.edu.tw (凱廷陳)

學校 : 臺北市立成功高級中學
編號 : 156157
來源 : [61.64.7.78]
最後登入時間 :
2023-11-27 01:09:33
f147. 1. 點餐系統 (Ordering System) -- 2020年6月TOI練習賽新手組 | From: [61.64.4.99] | 發表日期 : 2021-08-15 22:02

#include <iostream>

#include <cstdlib>

#include <string>

using namespace std;

 

 

string one[6]={"","Medium Wac","WChicken Nugget","Geez Burger","ButtMilk Crispy Chicken","Plastic Toy"};

string two[5]={"","German Fries","Durian Slices","WcFurry","Chocolate Sunday"};

int o[6]={0,4,8,7,6,3};

int t[5]={0,2,3,5,7};

int main()

{

   int n1,n2,a,total;

   while(cin>>a&&a!=0){

    if(a==1){

        cin>>n1;

           cout<<one[n1]<<" "<<o[n1]<<endl;

           total=total+o[n1];

           continue;

   }//if

 

if(a=2){

cin>>n2;

   cout<<two[n2]<<" "<<t[n2]<<endl;

   total=total+t[n2];

   continue;

}//if

}//while

cout<<"Total: "<<total;

   //system("pause");

   return 0;

}

 

 
ZeroJudge Forum