I also used this recursive method. So much easier than endless if statements
–
JethroNov 17 '14 at 3:57

Great solution. One tidbit though: a letter cannot be repeated more than 3 times in succession, and only powers of 10 can be repeated. Your algo converts IIII to 4; but I assumed you assumed validation would be left to the user!
–
LevinsonTechnologiesJul 27 at 14:48

Since most of the answers here are in Java, I'm posting the answer in C++ (since I am bored right now and nothing more productive to do :) But please, no downvotes except if code is wrong.
Known-issues = will not handle overflow

Please explain what this adds to the other 14 answers to this 3 year old question...
–
fancyPantsMar 23 at 14:31

It is just another way to solve the problem, mathematically. It adds Intelligence. Why negativate the answer? Just because you don't like it? Or you just didn't understand?
–
André SchonrockMar 23 at 19:49

Didn't downvote. Just left my comment cause just a code only answer after so many years...well, code only answers are generally not, er, upvote worthy.
–
fancyPantsMar 23 at 20:14

So please excuse me. I'm new on this site, and would like to interact positively, nothing against him, I am Brazilian, but of German origin. rs
–
André SchonrockMar 23 at 20:32