Cody

# Problem 63. Encode Roman Numerals

Solution 1205027

Submitted on 5 Jun 2017 by Augusto Mazzei
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
x = 1990; y_correct = 'MCMXC'; assert(isequal(dec2rom(x),y_correct))

rom = [] cor = 0 1 rom = 'M' n = 990 rom = 'MCM' n = 90 n = 90 rom = 'MCMXC' n = 0

2   Pass
x = 2008; y_correct = 'MMVIII'; assert(isequal(dec2rom(x),y_correct))

rom = [] cor = 0 1 rom = 'M' rom = 'MM' n = 8 rom = 'MMV' n = 3 rom = 'MMVI' rom = 'MMVII' rom = 'MMVIII'

3   Pass
x = 1666; y_correct = 'MDCLXVI'; assert(isequal(dec2rom(x),y_correct))

rom = [] cor = 0 1 rom = 'M' n = 666 rom = 'MD' n = 166 rom = 'MDC' n = 66 rom = 'MDCL' n = 16 rom = 'MDCLX' n = 6 rom = 'MDCLXV' n = 1 rom = 'MDCLXVI'

4   Pass
x = 49; y_correct = 'XLIX'; assert(isequal(dec2rom(x),y_correct))

rom = [] cor = 0 1 n = 49 rom = 'XL' n = 9 n = 9 rom = 'XLIX' n = 0

5   Pass
x = 45; y_correct = 'XLV'; assert(isequal(dec2rom(x),y_correct))

rom = [] cor = 0 1 n = 45 rom = 'XL' n = 5 rom = 'XLV' n = 0

6   Pass
x = 0; y_correct = ''; assert(isempty(dec2rom(x)))

rom = [] cor = 0 1