Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2e41387

Browse files
author
Amogh Singhal
authored
Update interger_to_roman_num.py
1 parent c0eea19 commit 2e41387

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

‎interger_to_roman_num.py‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@ def convertIntegerToRomanNum(input_num):
3434
# Explaination:
3535
# ===============
3636
# 289
37-
# 289//1000 --> 0, i=1
38-
# 289//900 --> 0, i=2
39-
# 289//500 --> 0, i=3
40-
# 289//400 --> 0, i=4
41-
# 289//100 --> 2, then i=4, result_str = 'C', input_num = 189
42-
# 198//100 --> 1, then i=4, result_str='CC', input_num = 89
43-
# 98//100 --> 0, then i=5
44-
# 98//50 --> 1, then i=6, result_str='CCL', input_num= 39
45-
# 39//50 --> 0, then i=6
46-
# 39//40 --> 0, then i=7
47-
# 39//10 --> 3, then i=8, result_str='CCLX', input_num=29
48-
# 29//10 --> 3, then i=8, result_str='CCLXX', input_num=19
49-
# 19//10 --> 3, then i=8, result_str='CCLXXX', input_num=9
50-
# 9//10 --> 0, then i=9
51-
# 9//9 --> 1, then i=9, result_str='CCLXXXIX', input_num=0
37+
# 289//1000 --> 0, i=1
38+
# 289//900 --> 0, i=2
39+
# 289//500 --> 0, i=3
40+
# 289//400 --> 0, i=4
41+
# 289//100 --> 2, then i=4, result_str = 'C', input_num = 189
42+
# 189//100 --> 1, then i=4, result_str='CC', input_num = 89
43+
# 89//100 --> 0, then i=5
44+
# 89//50 --> 1, then i=6, result_str='CCL', input_num= 39
45+
# 39//50 --> 0, then i=6
46+
# 39//40 --> 0, then i=7
47+
# 39//10 --> 3, then i=8, result_str='CCLX', input_num=29
48+
# 29//10 --> 3, then i=8, result_str='CCLXX', input_num=19
49+
# 19//10 --> 3, then i=8, result_str='CCLXXX', input_num=9
50+
# 9//10 --> 0, then i=9
51+
# 9//9 --> 1, then i=9, result_str='CCLXXXIX', input_num=0
5252
# EXIT

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /