Last active
January 3, 2020 22:11
-
-
Save herrozerro/8cd78b48110bf1daf4fb31ad79a85319 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static int convertRomanNumeral(string numeral) | |
{ | |
numeral = numeral.Replace("M", "DD"); | |
numeral = numeral.Replace("CD", "CCCC"); | |
numeral = numeral.Replace("D", "CCCCC"); | |
numeral = numeral.Replace("C", "LL"); | |
numeral = numeral.Replace("XL", "XXXX"); | |
numeral = numeral.Replace("L", "XXXXX"); | |
numeral = numeral.Replace("X", "VV"); | |
numeral = numeral.Replace("IV", "IIII"); | |
numeral = numeral.Replace("V", "IIIII"); | |
return numeral.Length; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment