Converting integer to Roman Numeral

前端 未结 9 1331
轮回少年
轮回少年 2020-12-16 08:27

I have a test due in about four hours and one of the questions asks us to convert a user-inputed integer up to 100 into a roman numeral. I think my code is very close (I fou

9条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-16 08:35

    One major problem is here:

    if(input = 100)
    

    I think you mean

    if(input == 100)
    

    You would have found this very easy if you stepped through your code in a debugger. Remember that a debugger is a programmers best friend, and the first tool to use if things doesn't work as intended.

提交回复
热议问题