BOJ 9498 시험 성적

Jmnote (토론 | 기여)님의 2018년 7월 11일 (수) 20:18 판

1 개요

BOJ 9498 시험 성적

[[분류:BOJ {{{단계}}}단계]]


2 Java

import java.util.*;
public class Main {
    private static String getGrade(int score) {
        if( score >= 90 ) return "A";
        if( score >= 80 ) return "B";
        if( score >= 70 ) return "C";
        if( score >= 60 ) return "D";
         return "F";
    }
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int score = sc.nextInt();
        System.out.print(getGrade(score));
    }
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}