Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int deromanize(String string){
- int result=0;
- for(int i = string.length(); i > 0; i-- ){
- for(RomanNumeral romanNumeral : RomanNumeral.values()){
- if(romanNumeral.name().equals(string.charAt(i-1)+"")){
- result += romanNumeral.getIntegerValue();
- }
- }
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment