Roman Number Form
Roman numerals still appear on clocks, in book chapters, and in event numbering. The function roman receives a natural number number from 1 to 3999 and converts it to a Roman numeral string. Pay attention to special cases like 4 and 9, where subtraction is used.
Примеры
Ввод
1Вывод
"I"Ввод
4Вывод
"IV"Ввод
9Вывод
"IX"Нужно реализовать
def roman(number: int) -> str:
Теги
stringsmath
Accedi per vedere la cronologia degli invii
AccediAccedi per usare l'AI Mentor
AccediVisible tests
1
Input
1Expected
"I"2
Input
4Expected
"IV"3
Input
9Expected
"IX"4
Input
49Expected
"XLIX"5
Input
1990Expected
"MCMXC"6
Input
2008Expected
"MMVIII"Focus radio
Paused · SomaFM · Fluid