#12498: java


zzser15963 (Momentary)

學校 : 國立新營高級中學
編號 : 57840
來源 : [110.30.168.151]
最後登入時間 :
2020-09-26 22:16:48
a053. Sagit's 計分程式 -- Sagit's 教學題 | From: [211.20.149.155] | 發表日期 : 2017-08-01 10:06

package test;

import java.util.Scanner;

public class pratice {

private static Scanner in;

public static void main(String[] args) {
in = new Scanner(System.in);
int N = 0, ans = 0;
while (in.hasNext()) {
N = 0;
N = in.nextInt();
if (0 <= N && N <= 10) {
System.out.println(6 * N);
} else if (N <= 20) {
System.out.println(60 + 2 * (N - 10));
} else if (N <= 40) {
System.out.println(80 + N - 20);
} else {
System.out.println(100);
}

}

}

}

 
ZeroJudge Forum