給一個整數 a,代表年齡
求對應的票價為多少
| 票名 | 年齡 | 價格 |
|---|---|---|
| 免票 | 0 ~ 5 歲 | 0 |
| 兒童票 | 6 ~ 11 歲 | 590 |
| 青少年票 | 12 ~ 17 歲 | 790 |
| 成人票 | 18 ~ 59 歲 | 890 |
| 敬老票 | 60 歲以上 | 399 |
評分結果(參考) : AC (2ms, 336KB)
#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int a;
cin >> a;
if(a >= 60) cout << "399";
else if(a >= 18) cout << "890";
else if(a >= 12) cout << "790";
else if(a >= 6) cout << "590";
else if(a >= 0) cout << "0";
return 0;
}