Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- R=['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I', 'I', 'I', 'I']
- A=[1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 3, 2, 1]
- a = int(input())
- res = ''
- while a:
- while a >= A[0]:
- a -= A[0]
- res += R[0]
- R.pop(0)
- A.pop(0)
- print(res)
- #очень примитивный перевод. да, это не через процедуру, но там муторнее.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement