#25135:


31415 (32陳俞安808)

學校 : 臺北市私立延平高級中學
編號 : 128530
來源 : [203.72.178.2]
最後登入時間 :
2022-06-20 13:07:29
b186. 97七區資訊學科1(改編) -- 97學年度彰雲嘉區資訊學科能力競賽 | From: [111.235.252.96] | 發表日期 : 2021-04-23 13:23

#include <bits/stdc++.h>

using namespace std;

int main() 

{

int a,b,c;

while(cin>>a>>b>>c)

{

if(a<10||c<2)

cout<<a<<" "<<"個餅乾,"<<b<<" "<<"盒巧克力,"<<c<<" "<<"個蛋糕。"<<endl;

else if(a>=10&&c>=2&&a/10==c/2)

cout<<a<<" "<<"個餅乾,"<<b+a/10<<" "<<"盒巧克力,"<<c<<" "<<"個蛋糕。"<<endl;

else if(a>=10&&c>=2&&a/10>c/2)

cout<<a<<" "<<"個餅乾,"<<b+c/2<<" "<<"盒巧克力,"<<c<<" "<<"個蛋糕。"<<endl;

else if(a>=10&&c>=2&&a/10<c/2)

cout<<a<<" "<<"個餅乾,"<<b+a/10<<" "<<"盒巧克力,"<<c<<" "<<"個蛋糕。"<<endl;

}

}

 
ZeroJudge Forum