<문제 풀이>
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
if (a <= 100 & a >= 90) {
System.out.print("A");
} else if (a <= 89 & a >= 80) {
System.out.print("B");
} else if (a <= 79 & a >= 70) {
System.out.print("C");
} else if (a <= 69 & a >= 60) {
System.out.print("D");
} else {
System.out.print("F");
}
}
}
이 문제는 딱히 어려운 것이 없었다.
scanner와 if문을 이용해서 범위만 정해주면 가능한 문제였다.
'자바' 카테고리의 다른 글
백준 알고리즘 - 14681번 사분면 고르기 [자바] (0) | 2023.06.26 |
---|---|
백준 알고리즘 - 2753번 윤년 [자바] (0) | 2023.06.26 |
백준 알고리즘 - 1330번 두 수 비교하기 [자바] (0) | 2023.06.26 |
백준 알고리즘 - 10172번 개 [자바] (4) | 2023.06.23 |
백준 알고리즘 - 10171번 고양이 [자바] (0) | 2023.06.23 |