9498번 시험 성적

박철진·2021년 7월 21일
0

알고리즘

목록 보기
3/5
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        int point = scan.nextInt();

       
            if (point >= 90) {
                System.out.println("A");
            } else if (point >= 80) {
                System.out.println("B");
            } else if (point >= 70) {
                System.out.println("C");
            } else if (point >= 60) {
                System.out.println("D");  
            } else {
                System.out.println("F");
            }
        
    }
}

if(point >= 90 && point <= 100) {
System.out.println("A");
}

이렇게 쓰지 않아도 시험 점수 범위 확인하는데는 이상이 없다는거 알 게 되었다.

profile
개발자를 위해 기록하는 습관

0개의 댓글