OpenJudge - 01047:Round and Round We Go
没啥好说的,一个大整数乘法的题目,用库就可以了。
代码~
from decimal import Decimal, getcontext, MAX_PREC
getcontext().prec = MAX_PREC
while True:
try:
num = input()
for k in range(1, len(num)+1):
check = Decimal(num)*Decimal(k)
if str(check) not in num*2:
print(f'{num} is not cyclic')
break
else:
print(f'{num} is cyclic')
except EOFError:
break