본문 바로가기
Coding Test/백준

[백준 9498번 - java] 시험 성적

by olli2 2021. 11. 3.

https://www.acmicpc.net/problem/9498

 

내 답안

import java.io.*;
import java.util.*;

public class Main{
	public static void main(String[] args) throws IOException {
		
		Scanner s = new Scanner(System.in);
		int score = s.nextInt();
		
		if (score <= 100 && score >= 90) {
			System.out.println("A");
		}
		else if (score <= 89 && score >= 80) {
			System.out.println("B");
		}
		else if (score <= 79 && score >= 70) {
			System.out.println("C");
		}
		else if (score <= 69 && score >= 60) {
			System.out.println("D");
		}
		else System.out.println("F");
	}
}