Autor |
Mesaj |
|
The sum of all
digit number that can be formed by using
Attempt: selecting
numbers from
is
help me
--- dtiwari
|
|
There are 4*5*5=100 such 3 digit numbers (the first digit cannot be 0).
Each of 0,1,2,3,4 appears 4*5=20 times as the unit digit, adding up thus to 20*(0+1+2+3+4)=200.
Each of 0,1,2,3,4 appears 4*5=20 times as the tens digit, adding up thus to 20*(0+1+2+3+4)*10=2000.
Finally, Each of 1,2,3,4 appears 5*5=25 times as the hundreds digit, adding up thus to 25*(1+2+3+4)*100=25000.
Hence the sum of all numbers equals 200+2000+25000=27200.
w=Words([0,1,2,3,4],3)
s=0
for c in w:
if c[0]!=0:
s=s+int(str(c))
print s
27200
|