# 002public class if-else結構式 { if (條件判斷) {敘述1;…} else {敘述2;…} 成績分級 ``` public static void main(String[] args) { int Score = (int)(Math.random()*101); // 0 - 100 System.out.println(Score); if (Score >= 90){ System.out.println("A"); }else if (Score >= 80){ System.out.println("B"); }else if (Score >= 70){ System.out.println("C"); }else if (Score >= 60){ System.out.println("D"); }else{ System.out.println("E"); } } } ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up