题解 | 小红的“质数”寻找
小红的“质数”寻找
https://www.nowcoder.com/practice/0b98a50ea30e4a3a9fe08a46eeb5f7fc
from sys import stdin,stdout
input = lambda:stdin.readline().strip()
for _ in range(int(input())):
x = input()
len1 = len(x)-1
s = int(x[0])
if s == 1:
p = "2"
elif s == 2:
p = "3"
elif s == 3:
p = "5"
elif s == 4:
p = "7"
elif s == 5:
p = "7"
elif s == 6:
p = "7"
elif s == 7:
p = "11"
elif s == 8:
p = "11"
elif s == 9:
p = "11"
stdout.write(p+"0"*len1+"\n")
查看9道真题和解析