L1-028 判断素数 python
python 实现
import math num=int(input()) lst=[] for i in range(num): lst.append(int(input())) for i in range(num): flag = 1 for j in range(2, int(math.sqrt(lst[i])) + 1): if lst[i] % j == 0: flag = 0 if lst[i] <= 1: flag = 0 if flag==1: print("Yes") else: print("No")