Roman Numerals
Roman numerals still appear in book chapters, clocks, and event numbering. Write a function int_to_roman that converts the integer num into Roman numeral notation. The input number is from 1 to 3999. Return the result as a string made of Roman symbols.
Примеры
Ввод
3Вывод
"III"Ввод
58Вывод
"LVIII"Ввод
1994Вывод
"MCMXCIV"Нужно реализовать
def int_to_roman(num: int) -> str:
Теги
stringsmathhashmap
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign inVisible tests
1
Input
3Expected
"III"2
Input
58Expected
"LVIII"3
Input
1994Expected
"MCMXCIV"4
Input
4Expected
"IV"5
Input
3999Expected
"MMMCMXCIX"6
Input
40Expected
"XL"Focus radio
Paused · SomaFM · Fluid