#33456: c++解


yp11052079@yphs.tp.edu.tw (909-08崔智媛)

學校 : 臺北市私立延平高級中學
編號 : 206288
來源 : [203.72.178.2]
最後登入時間 :
2024-04-29 16:23:00
a053. Sagit's 計分程式 -- Sagit's 教學題 | From: [203.72.178.1] | 發表日期 : 2023-01-07 08:22

c++
#include <iostream> using namespace std; int main(){ int n;
cin >> n; if(n <= 10){ cout << n * 6 << endl; }else if((n > 10) && (n <= 20)){ cout << (n - 10) * 2 + 60 << endl; }else if((n > 20) && (n <= 40)){ cout << (n - 20) + 80 << endl; }else{ cout << "100" <<endl; }}
 
ZeroJudge Forum