Skip to content

Commit

Permalink
5 lesson5
Browse files Browse the repository at this point in the history
  • Loading branch information
fengchenfcpp committed Nov 15, 2024
1 parent c7305b1 commit de8c832
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CartonPython/lesson5/ch5_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

i = 100; r = 0; s = 0; t = 0

while i < 1000:
while i < 2000:
r = i // 100
s = (i - r * 100) // 10
t = i - r * 100 - s * 10
Expand Down
13 changes: 13 additions & 0 deletions CartonPython/lesson5/ch5_4_for_fcpp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# coding=utf-8
# Filename: ch5_4_for_fcpp.py

i = 100; r = 0; s = 0; t = 0

while i < 5000000:
r = i // 100
s = (i - r * 100) // 10
t = i - r * 100 - s * 10
if i == (r ** 3 + s ** 3 + t ** 3):
print("i = " + str(i))

i += 1

0 comments on commit de8c832

Please sign in to comment.