Commit 72d9fa12 by BellCodeEditor

auto save

parent e873b954
Showing with 9 additions and 1 deletions
...@@ -184,6 +184,15 @@ print(s) ...@@ -184,6 +184,15 @@ print(s)
''' '''
''' '''
#方法二
c = 0
for i in range(200,501):
if int(str(i)[0])**3 + int(str(i)[1])**3 +int(str(i)[2])**3==i :
print(str(i)+"是水仙花数")
c+=1
print(c)
'''
'''
10、编程计算1+3+9+27+...+2187的值 10、编程计算1+3+9+27+...+2187的值
s=0 s=0
i = 1 i = 1
...@@ -258,7 +267,6 @@ for i in range(0,len(n)): ...@@ -258,7 +267,6 @@ for i in range(0,len(n)):
t = n.count(n[i]) t = n.count(n[i])
if t>x: if t>x:
x = t x = t
k = i
print("重复次数最多的是:",n[i],"重复了",x,"次") print("重复次数最多的是:",n[i],"重复了",x,"次")
''' '''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment