质因数分解 枚举到n的平方根(得包括平方根) 偶数去除
import math
n int(input())
if n % 2 0:print(max(n // 2,2))
else:for i in range(3,int(math.sqrt(n)) 1,2):if n % i 0:print(max(n // i,i))
PTA | 1005 Spell It Right
1005 Spell It Right
作者 CHEN, Yue
单位 浙江大学
Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English.
Input Specification:
Each input file cont…