PAT (Basic Level) Practice Python解法 1091 N-自守数(for循环与break的判定)
m = int(input())
ck = list(map(int,input().split()))
for num in ck:
lennum = len(str(num))
for n in range(10):
zs = n*num*num
mw = zs%(10**lennum)
if mw == num:
print(n, zs)
break
else:
print('No')