#include
#include
using namespace std;
string arabicToRoman(unsigned &number)
{
const unsigned count = 13;unsigned arabic[count] = { 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1
}, i, j;
string roman[count] = { "M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX",
"V", "IV", "I" }, result = "";
for (i = 0; i < count; i++) {
for (j = 0; j < number / arabic[i]; j++) {
result += roman[i];
}
number %= arabic[i];
}
return result;
}
int main()
{
unsigned uin = 0;
cin >> uin;
cout << arabicToRoman(uin);<br>system("pause");
return 0;
}