Post

[BOJ 9498] 시험 성적

Baekjoon Online Judge 9498(Java 11)
[시험 성적] 문제 풀이

[BOJ 9498] 시험 성적

-> 문제 바로가기



시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초128 MB49300026958422444854.787%

문제


  • 시험 점수를 입력받아 90 ~ 100점은 A, 80 ~ 89점은 B, 70 ~ 79점은 C, 60 ~ 69점은 D, 나머지 점수는 F를 출력하는 프로그램을 작성하시오.


입력


  • 첫째 줄에 시험 점수가 주어진다. 시험 점수는 0보다 크거나 같고, 100보다 작거나 같은 정수이다.


출력


  • 시험 성적을 출력한다.


예제


1
2
// 입력
100
1
2
// 출력
A


출처



알고리즘 분류








제출



내 제출


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import java.io.*;
import java.util.*;

public class Main {
    public static void solution() throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));

        StringTokenizer st = new StringTokenizer(br.readLine(), " ");

        int point = Integer.parseInt(st.nextToken());

        if (90 <= point) {
            bw.write("A");
        } else if (80 <= point) {
            bw.write("B");
        } else if (70 <= point) {
            bw.write("C");
        } else if (60 <= point) {
            bw.write("D");
        } else {
            bw.write("F");
        }

        bw.flush();
        bw.close();
        br.close();
    }

    public static void main(String[] args) throws IOException {
        solution();
    }
}


런타임메모리
132 ms14392 KB


Reference


This post is licensed under CC BY 4.0 by the author.