def Prime_num(num): if num <= 1: print("请输入大于1的值") else: for i in range(2,num+1): for j in range(2,i): if i % j == 0: break else: print(i) num = eval(input("请输入数值:")) Prime_num(num)
欢迎分享,转载请注明来源:内存溢出
def Prime_num(num): if num <= 1: print("请输入大于1的值") else: for i in range(2,num+1): for j in range(2,i): if i % j == 0: break else: print(i) num = eval(input("请输入数值:")) Prime_num(num)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)