15std::string
fill(
char c,
int n) {
28 return fill(
'i', 5 - n) +
"v";
30 return std::string(
"v") +
fill(
'i', n - 5);
32 return fill(
'i', 10 - n) +
"x";
46 return std::string(
"d") +
fill(
'c', n / 100 - 5) +
62 return fill(
'I', 5 - n) +
"V";
64 return std::string(
"V") +
fill(
'I', n - 5);
66 return fill(
'I', 10 - n) +
"X";
80 return std::string(
"D") +
fill(
'C', n / 100 - 5) +
92 std::cout <<
"\t\tRoman numbers converter\n\n";
93 std::cout <<
"Type in decimal number between 0 up to 4000 (exclusive): ";
95 std::cout << n <<
" in Upper Roman Numerals is " <<
toupperRoman(n) <<
"\n";
96 std::cout << n <<
" in Lower Roman Numerals is " <<
tolowerRoman(n) <<
"\n";
std::string tolowerRoman(int n)
std::string toupperRoman(int n)
std::string fill(char c, int n)