Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from math import floor
- value = 2800
- h,f,t = 0,0,0
- if value < 5000:
- if value % 1000 == 0:
- f = f + 1
- h = h + 5
- t = t + int(((value-1000)/1000))
- elif value % 500 == 0:
- f = f + 1
- t = t + int(((value-1000)/1000))
- elif value % 1000 < 500:
- h = h + ((value % 1000)/100)
- t = t + floor(value/1000)
- else:
- f = f + 1
- t = t + floor(value/1000)
- h = h + ((value % 1000)/100) - 5
- else:
- if value % 1000 == 0:
- f = f + 2
- t = t + int(((value-1000)/1000))
- elif value % 500 == 0:
- f = f + 1
- t = t + int(((value-1000)/1000))
- elif value % 1000 < 500:
- h = h + ((value % 1000)/100)
- t = t + floor(value/1000)
- else:
- f = f + 1
- t = t + floor(value/1000)
- h = h + ((value % 1000)/100) - 5
- print("Hundreds = " + str(int(h)))
- print("Five Hundreds = " + str(int(f)))
- print("Thosuands = " + str(int(t)))
- print(str(int(h*100)) + " + " + str(int(f*500)) + " + " + str(int(t*1000)) + " = " + str(value))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement