鱼C论坛

 找回密码
 立即注册
查看: 1358|回复: 2

求代码鸭

[复制链接]
发表于 2020-4-3 08:05:30 | 显示全部楼层
  1. from math import sqrt,floor

  2. n=int(input())

  3. while not n&1:
  4.     n>>=1
  5.     print(2)
  6.         
  7. temp=3
  8. maximum=floor(sqrt(n))+1

  9. while temp<maximum:
  10.     if not n%temp:
  11.         while not n%temp:
  12.             n//=temp
  13.             print(temp)

  14.         maximum=floor(sqrt(n))+1

  15.     temp+=2

  16. if n!=1:
  17.     print(n)
复制代码
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-10-13 04:44

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表