---
# System prepended metadata

title: ZeroJudge-f373.週年慶Anniversary解題思路

---

ZeroJudge-f373.週年慶Anniversary解題思路
=====================
### 題目連結:https://zerojudge.tw/ShowProblem?problemid=f373

:::warning
 - 利用[多重選擇語法](https://hackmd.io/@cube/SJO2gf1mt#4-%E5%A4%9A%E9%87%8D%E9%81%B8%E6%93%87-ifelse-ifelse-%E8%AA%9E%E6%B3%95)判斷。
 - 若<font color=cake>有折價且價格相同</font>，則<font color=cake>以天天百貨</font>當作優先考量 ; 若<font color=fart>無折價</font>，輸出價格為<font color=fart>原價</font>。
 
 
:::

### C++程式碼
```c=
#include<bits/stdc++.h>
using namespace std;

int main()
{
    int a;
    while(cin>>a){
    int c,b;
    if (a/1000>=0){

        b=a-(a/2000)*200;
        c=a-(a/1000)*100;

        if (c>b)
            cout<< b <<" 0\n";
        else if(c<b)
            cout<< c <<" 1\n";
        else if(b==c && a/1000!=0)
            cout<< b <<" 0\n";
        else
            cout<< a <<" 0\n";
        }
    }
    return 0;
}
```
