Pure Programmer
Blue Matrix


Cluster Map

Project: Roman Numerals

Ancient Rome used a system of numbers much different that the Hindu-Arabic numerals we use today. Today Roman Numerals are only used on movie copyrights, Olymipic games and the Superbowl. Write a program that converts the numbers from 1-2500 to [[Roman Numerals]] and prints them. Write a function that specifically does the Roman Numeral conversion. It should take an integer and return a string. The following table specifies the Roman Numerals and their corresponding integer values.

SymbolValue
I1
IV4
V5
IX9
X10
XL40
L50
XC90
C100
CD400
D500
CM900
M1000

With the right algorithm, generating Roman Numerals with the subtractice notation illustrated above is as simple as the additive form.

Output
$ swiftc RomanNumerals.swift -I . -L . -lUtils error: link command failed with exit code 1 (use -v to see invocation) ld: library not found for -lUtils clang: error: linker command failed with exit code 1 (use -v to see invocation)

Solution