Roman numbers (1)

Write a program that reads several numbers and prints their equivalent Roman number.

Remember that Roman numbers make use seven uppercase letters, which correspond to the following values:

Letter I V X L C D M
Value 1 5 10 50 100 500 1000

These are the rules of Roman numbers:

Input

Input consists of several natural numbers between 1 and 3999. (Roman people did not know zero, and the system described above cannot represent numbers greater than or equal to 4000.)

Output

For each number, print its equivalent Roman number.

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-01-25T10:20:28.223Z

© Jutge.org, 2006–2026.
https://jutge.org