我需要ceil和floor 3/2结果(1.5)而不使用import math.
import math
math.floor(3/2)=> 3//2 math.ceil(3/2)=>?
math.floor(3/2)
3//2
math.ceil(3/2)
好的,问题在于:将所有数字加上15 + 45 + 15 + 45 + 15 ...加N项.
sum = (n//2) * 5 + int(n/2) * 15
python python-3.x
python ×1
python-3.x ×1