728x90
9286번: Gradabase
For each case, output the line “Case x:” where x is the case number, on a single line, followed by a list of integers, each on a new line, between 1 and 6. If the student has graduated from the school, do not print them.
www.acmicpc.net
문제 풀이
조건에 따라 입력값을 받고, 입력값 + 1이 1이상 6이하일 경우 출력하는 문제이다.
정답 코드
import sys
input = sys.stdin.readline
for i in range(1, int(input()) + 1) :
print(f"Case {i}:")
for _ in range(int(input())) :
g = int(input())
if g + 1 > 0 and g + 1 < 7 : print(g + 1)
728x90
'Algorithm > PS' 카테고리의 다른 글
[BOJ/백준] 9295 - 주사위 [python] (0) | 2023.03.24 |
---|---|
[BOJ/백준] 9288 - More Dice [python] (0) | 2023.03.24 |
[BOJ/백준] 9161 - Sir Bedavere’s Bogus Division Solutions [python] (0) | 2023.03.24 |
[BOJ/백준] 9094 - 수학적 호기심 [python] (0) | 2023.03.24 |
[BOJ/백준] 9085 - 더하기 [python] (0) | 2023.03.23 |