728x90
문제 풀이
두 입력값 A와 B 사이의 완전 세제곱수의 갯수를 출력해준다.
정답 코드
for i in range(1, int(input()) + 1) :
A, B = map(int, input().split())
cnt = 0
x = 1
while x ** 3 <= B :
if x ** 3 >= A : cnt += 1
x += 1
print(f"Case #{i}: {cnt}")
728x90
'Algorithm > PS' 카테고리의 다른 글
[BOJ/백준] 9773 - ID Key [python] (0) | 2023.03.27 |
---|---|
[BOJ/백준] 9771 - Word Searching [python] (0) | 2023.03.27 |
[BOJ/백준] 9723 - Right Triangle [python] (0) | 2023.03.27 |
[BOJ/백준] 9713 - Sum of Odd Sequence [python] (0) | 2023.03.27 |
[BOJ/백준] 9699 - RICE SACK [python] (0) | 2023.03.27 |