TQC+ JAVA 208 分級制度
import java.util.*;
class JPA02 {
static Scanner keyboard = new Scanner(System.in);
public static void main(String[] args) {
test();
test();
test();
test();
test();
}
public static void test() {
System.out.println("Input:");
int a = keyboard.nextInt();
if(a>=90)
System.out.println("Your grade is A");
else if(a>=80)
System.out.println("Your grade is B");
else if(a>=70)
System.out.println("Your grade is C");
else if(a>=60)
System.out.println("Your grade is D");
else
System.out.println("Your grade is F");
}
}
沒有留言:
張貼留言