#34930: 用 if 暴力解 (C++)


yp11151208@yphs.tp.edu.tw (805-42葉宏湧)

學校 : 臺北市私立延平高級中學
編號 : 197051
來源 : [203.72.178.1]
最後登入時間 :
2023-09-24 09:29:19
d584. 技能點數skill -- jack1 | From: [203.72.178.1] | 發表日期 : 2023-04-27 17:15

#include<bits/stdc++.h>
using namespace std;
main(){
    ios_base::sync_with_stdio(false);
    int a,b,t;
    while(cin>>a>>b){
        if(!a){cout<<0<<endl; continue;}
        t=1;
        if(b>=30) t++;
        if(b>=70) t++;
        if(b>=120) t+=3;
        if(a==2) t+=(b-8)*3;
        else t+=(b-10)*3;
        cout<<t<<endl;
    }
}

 
ZeroJudge Forum