알고리즘/백준 / / 2021. 8. 24. 00:16

[백준 BAEKJOON] 9498번 시험 성적 문제 (java)

소스 코드
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		int score;
		
		Scanner sc = new Scanner(System.in);
		score = sc.nextInt();
		
		if(score >= 90) {
			System.out.println('A');
		}else if( 80 <= score && score <= 89) {
			System.out.println('B');
		}else if( 70 <= score && score <= 79) {
			System.out.println('C');
		}else if( 60 <= score && score <= 69) {
			System.out.println('D');
		}else {
			System.out.println('F');			
		}
	}
}
문제 링크

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

반응형
  • 네이버 블로그 공유
  • 네이버 밴드 공유
  • 페이스북 공유
  • 카카오스토리 공유