This commit is contained in:
@@ -3,9 +3,9 @@ class Program {
|
||||
private string num2Roman(int $num) {
|
||||
int $n = intval($num);
|
||||
string $result = '';
|
||||
int[] $lookup = array('M' => 1000, 'CM' => 900, 'D' => 500, 'CD' => 400,
|
||||
int[] $lookup = {'M' => 1000, 'CM' => 900, 'D' => 500, 'CD' => 400,
|
||||
'C' => 100, 'XC' => 90, 'L' => 50, 'XL' => 40,
|
||||
'X' => 10, 'IX' => 9, 'V' => 5, 'IV' => 4, 'I' => 1);
|
||||
'X' => 10, 'IX' => 9, 'V' => 5, 'IV' => 4, 'I' => 1};
|
||||
|
||||
int $matches;
|
||||
foreach($lookup as $roman => $value) {
|
||||
|
Reference in New Issue
Block a user