#12498: java


zzser15963 (Momentary)

School : 國立新營高級中學
ID : 57840
IP address : [36.234.45.136]
Last Login :
2019-09-07 15:51:39
a053. Sagit's 計分程式 -- Sagit's 教學題 | From: [211.20.149.155] | Post Date : 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