Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Find numbers with given sum of digits
#python 3.5.2 import math #sum to find sum = 8 #counter c = 0 #range for i in range(1,999): r100 = math.floor(i/100) r10 = math.floor((i-r100*100)/10) r1 = i-r100*100-r10*10 r = r100+r10+r1 if (r == sum): c+=1 #number, sum, counter print (i, r, c)
run
|
edit
|
history
|
help
0
Page353ex42
Prueba
Single and double qoute
Breadth-First Path Finding
Rasty profile
Get count
Hai
Два шарика в квадрате
jhjhh
Faiha #4