코테/BOJ
백준 4375 [1] 파이썬
동 캄
2022. 10. 9. 16:40
반응형
https://www.acmicpc.net/problem/4375
4375번: 1
2와 5로 나누어 떨어지지 않는 정수 n(1 ≤ n ≤ 10000)가 주어졌을 때, 1로만 이루어진 n의 배수를 찾는 프로그램을 작성하시오.
www.acmicpc.net
# 백준 4375
import sys
input = sys.stdin.readline
while True:
ans = 1
a = 1
s = input().rstrip()
if s:
num = int(s)
while True:
if a % num == 0:
print(ans)
break
else:
a *= 10
a += 1
ans += 1
else:
break
반응형