Skip to content

Commit 91c2256

Browse files
committed
split int
1 parent 634f893 commit 91c2256

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎newcodes/answers/q59.py‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env python
2+
# coding=utf-8
3+
4+
def split_int(a):
5+
for i in range(2, 100, 1):
6+
if a % i == 0:
7+
return i
8+
return 0
9+
10+
if __name__ == '__main__':
11+
a = int(input('input a number, please.'))
12+
val = split_int(a)
13+
while val > 1:
14+
print(val)
15+
a = a / val
16+
val = split_int(a)

0 commit comments

Comments
 (0)