Cody

Solution 2013843

Submitted on 11 Nov 2019 at 13:10 by Earnest
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))

ind = 21 ind = 18 ind = 8

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

ind = 21 ind = 21 ind = 3 ind = 1 ind = 1 ind = 1

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

ind = 21 ind = 17 ind = 11 ind = 7 ind = 5 ind = 3 ind = 1

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

ind = 6 ind = 4

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

ind = 6 ind = 3

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