题解列表
编写题解 2779: 输出绝对值,python超简单
摘要:解题思路:注意事项:参考代码:x=float(input())if x>=0: print(f'{x:.2f}')else : ……
编写题解 2785: 判断一个数能否同时被3和5整除
摘要:解题思路:注意事项:参考代码:n=int(input())if n%3==0 and n%5==0: print("YES")else : &……
Python实现求平均数
摘要:解题思路:输入的分隔符是换行符注意事项:参考代码:i=1b=0.0while(i<=12): c=list(map(float, input().split()))&n……
Python满分代码
摘要:解题思路:python真nb,写个全局变量,然后在函数中直接引用注意事项:参考代码:num=int(input())def f(j,a): i=0 ……
Python满分代码
摘要:解题思路:注意事项:房价第二年才开始涨参考代码:s,v=map(int,input().split())n=4tot_s=s*npce=200*((1+v/100)**(n-1))while(n<……
Python满分代码
摘要:解题思路:ceil是向上取整,sqrt是开2次方注意事项:路程往返乘2参考代码:import mathn = int(input())i = 1totime = 0while(i <= n):&……
1013基础解法(简短输出)
摘要:题目:求Sn=a+aa+aaa+…+aa…aaa(有n个a)之值,其中a是一个数字,为2。 例如,n=5时=2+22+222+2222+22222,n由键盘输入。解题关键点:1:已知a=2,Sn为所求……
Python多行读入、循环处理、break跳出循环
摘要:解题思路:注意事项:import sys# 读取所有行(直到文件结束)charge = list(map(int, sys.stdin.read().strip().split()))print(ch……