标签:port span lse inpu def col color math import
import math def prime(n): if n <= 1: return False if n == 2: return True i = 2 while i <= math.sqrt(n): if n % i == 0: return False i += 1 return True a = [] for i in range(2, 100): if prime(i): a.append(i) temp = int(input("请输入一个数:")) flag = False print(temp, "=", end=" ") i = 0 while temp > 1: if temp % a[i] == 0: if flag: print("*", end="") else: flag = True print(a[i], end="") temp /= a[i] else: i += 1
标签:port span lse inpu def col color math import
原文地址:https://www.cnblogs.com/Chaosliang/p/11594993.html