• 1、统计单词的个数
• 2、将秒数转换成时分秒
• 3、复数的运算与最值
• 4、 干掉CPA会长

1、统计单词的个数

``````s = input().split()
print("count = {}".format(len(s)))``````

2、将秒数转换成时分秒

divmod() 函数https://www.runoob.com/python3/python3-func-divmod.html

``````seconds = int(input())
m,s = divmod(seconds,60)
h,m = divmod(m,60)
print("%d:%d:%d"%(h,m,s))``````

3、复数的运算与最值

``````n = input().split()
z1 = eval（n[0] + '+' + n[1] + 'j')
z2 = eval（n[2] + '+' + n[3] + 'j')

sub = z1 - z2
mul = z1 * z2
div = z1 / z2
ls=sorted(q,key=lambda x:(x.real,-x.imag),reverse=True)

for c in lsl:
if int(c.real)==0:
if int(c.imag)==0:
print("{0}")
else:
print("{",end='')
print("{:.0f}i".format(c.imag),end='')
else:
if int(c.imag)==0:
print("{",end='')
print("{:.0f}".format(c.real),end='')
print("}")
elif int(c.imag)>0:
print("{",end='')
print("{:.0f}+{:.0f}i".format(c.real,c.imag),end='')
print("}")
else:
print("{",end='')
print("{:.0f}{:.0f}i".format(c.real,c.imag),end='')
print("}")
# q = [1+2j,1-1j,2+1j,3-5j,3-4j]
# ls=sorted(q,key=lambda x:(x.real,-x.imag),reverse=True)
# print(ls)``````

4、 干掉CPA会长

``````name,luckpointtarget = input().split()
luckpointtarget = int(luckpointtarget)
huizhangpoints = 0
yourspoints = 1
while huizhangpoints<luckpointtarget and yourspoints<luckpointtarget:
huizhangpoints += yourspoints
yourspoints += huizhangpoints
if huizhangpoints>=luckpointtarget:
print("jiangcheng")
print(huizhangpoints)
else:
print(name)
print(yourspoints)``````