题解 | #质数因子#

质数因子

http://www.nowcoder.com/practice/196534628ca6490ebce2e336b47b3607

Remember to add a space at the very end of the character.

import math
x = int(input())
for i in range(2, int(math.sqrt(x))+1):
    while x % i == 0:
        print(i, end = ' ')
        x = x // i
if (x > 2):
    print(x, end = ' ')
全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务