Notice
Recent Posts
Recent Comments
Link
«   2025/04   »
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
Archives
Today
Total
관리 메뉴

hwooo

(C) 9498번: 시험 성적 본문

Study/Algorithm

(C) 9498번: 시험 성적

hwooo 2022. 6. 4. 02:15

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

 

9498번: 시험 성적

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

www.acmicpc.net


풀이

-


코드

#include <stdio.h>
int main() {
	int score;
	scanf("%d", &score);
	if (score >= 90) printf("A");
	else if (score < 90 && score >= 80) printf("B");
	else if (score < 80 && score >= 70) printf("C");
	else if (score < 70 && score >= 60) printf("D");
	else printf("F");
}

'Study > Algorithm' 카테고리의 다른 글

(C) 2884번: 알람 시계  (0) 2022.06.04
(C) 14681번: 사분면 고르기  (0) 2022.06.04
(C) 2753번: 윤년  (0) 2022.06.04
(C) 1330번: 두 수 비교하기  (0) 2022.06.03
(C) 25083번: 새싹  (0) 2022.06.03