mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-27 06:23:08 +08:00
Format code with prettier (#3375)
This commit is contained in:
@ -9,10 +9,36 @@ package com.thealgorithms.conversions;
|
||||
*/
|
||||
public class IntegerToRoman {
|
||||
|
||||
private static int[] allArabianRomanNumbers
|
||||
= new int[]{1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1};
|
||||
private static String[] allRomanNumbers
|
||||
= new String[]{"M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"};
|
||||
private static int[] allArabianRomanNumbers = new int[] {
|
||||
1000,
|
||||
900,
|
||||
500,
|
||||
400,
|
||||
100,
|
||||
90,
|
||||
50,
|
||||
40,
|
||||
10,
|
||||
9,
|
||||
5,
|
||||
4,
|
||||
1,
|
||||
};
|
||||
private static String[] allRomanNumbers = new String[] {
|
||||
"M",
|
||||
"CM",
|
||||
"D",
|
||||
"CD",
|
||||
"C",
|
||||
"XC",
|
||||
"L",
|
||||
"XL",
|
||||
"X",
|
||||
"IX",
|
||||
"V",
|
||||
"IV",
|
||||
"I",
|
||||
};
|
||||
|
||||
// Value must be > 0
|
||||
public static String integerToRoman(int num) {
|
||||
|
Reference in New Issue
Block a user