#!/usr/bin/python3 # # This program that takes a number N (a positive integer) in decimal # notation from the console, and prints its value as a roman numeral. # ten_zero = ['', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'] ten_one = ['', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC'] ten_two = ['', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM'] n = int(input('input a number: ')) r = '' while n >= 1000: r = r + 'M' n = n - 1000 c = n // 100 r = r + ten_two[c] n = n - c*100 d = n // 10 r = r + ten_one[d] n = n - d*10 r = r + ten_zero[n] print(r)