#15093: C++


wish.rirf@gmail.com (C++ 與我)

School : 臺北市私立薇閣高級中學
ID : 82132
IP address : [223.136.142.130]
Last Login :
2020-05-20 16:27:58
a053. Sagit's 計分程式 -- Sagit's 教學題 | From: [223.137.105.233] | Post Date : 2018-09-11 18:09

#include<iostream>
using namespace std;
unsigned short in;
main(){
while(cin>>in){
if(in<=10)
cout<<in*6<<endl;
else if(in>=10&&in<=20)
cout<<60+(in-10)*2<<endl;
else if(in>=20&&in<=40)
cout<<80+(in-20)<<endl;
else
cout<<100<<endl;
}
}

 
ZeroJudge Forum