Commit b518ef3c by BellCodeEditor

auto save

parent ea5fdbc2
Showing with 35 additions and 14 deletions
cnt = 0#count the sum of reault
for i in range(1,5):
for j in range(1,5):
for k in range(1,5):
if i!=j and i!=k and j!=k
print i*100+j*10+k
cnt+=1
print cnt
\ No newline at end of file
i = int(raw_input('Enter the profit:'))
arr = [1000000,600000,400000,200000,100000,0]
rat = [0.01,0.015,0.03,0.05,0.075,0.1]
r = 0
for idx in range(0,6):
if i>arr[idx]:
r+=(i-arr[idx])*rat[idx]
print (i-arr[idx])*rat[idx]
i=arr[idx]
print r
\ No newline at end of file
import datetime
import time
dtstr =str(raw_input('Enter the datetime:(20151215):'))
dt = datetime.datetime.strptime(dtstr,"%Y%m%d")
another dtstr = dtstr[:4] + '0101'
another dt = datetime.datetime.strptime(another dtstr,"%Y%m%d")
print(int((dt-another_dt).days) + 1
\ No newline at end of file
# 古代测量臂力是靠不同重量的石锁,只能测整数哦。
# 最小的石锁是30公斤最大的石锁是100公斤,注意输入的数字哦。
# 请优化刚刚的代码,并增添交互效果,和自动输出最强三人信息的功能~
# 问询处
power=input("你的臂力值是:")
name=input("你的名字:")
# 归档处
hero=['赵一',30,'丁二',37,'孙五',52,'王猛',89,'周亮',98,'张宇',100]
for i in range(len(hero)):
if i%2==1 and hero[i]>=int(power):
hero.insert(i-1,name)
hero.insert(i,power)
import math
num = 1
while True:
if math.sqrt(num + 100)-int(math.sqrt(num + 100))==0 and math.sqrt(num + 268)-int(math.sqrt(num + 268))==0:
print(num)
break
print(hero[-6:])
# 打印出臂力最强的三个人和他们对应的臂力值:
num += 1
\ No newline at end of file
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