题解列表
1431蓝桥杯2014年第五届真题-分糖果题解
摘要:解题思路:运用列表里面最后一个数据的索引可以是n-1也可以是-1,来进行遍历注意事项:参考代码:n= int(input()) #一开始为了方便自己查看,输入里面有个‘人数’,然后一直错误list……
数学(转换为两点的距离计算)
摘要:d1,p1,q1,d2,p2,q2=map(int,input().split())m=1 # 类似根号3dict1={0:-1,1:-0.5,2:0.5,3:1,4:0.5,5:-0.5}dict2……
将多位数拆解为单位数,善用整除和求余
摘要:解题思路:注意事项:参考代码:n=input()u=0##for _ in n:## print('_:',_)## if int(_)%2!=0:## u=u……
编写题解 2847: 找第一个只出现一次的字符
摘要:解题思路:Python count() 方法用于统计字符串里某个字符或子字符串出现的次数。注意事项:1)语法:str.count(sub, start= 0,end=len(string))2)参数解……
编写题解 2846: 统计数字字符个数
摘要:解题思路:str.isdigit(),判断字符是否为数字注意事项:参考代码:n=input()
count=0
for i in n:
if i.isdigit(): #判断字符是否为数……
[编程入门]矩阵对角线求和,最容易理解的解法,非常暴力
摘要:解题思路:注意事项:没有丝毫含金量参考代码:x=list(map(int,input().split()))y=list(map(int,input().split()))z=list(map(int……
编写题解 2837: 年龄与疾病
摘要:解题思路:1)定义4个count计数器2)输出%:'%.2f%%'%n注意事项:参考代码:n=int(input()) #病人数目
ages=list(map(int,input()……
编写题解 2836: 数组逆序重放
摘要:解题思路:逆序:nums[::-1]注意事项:参考代码:n=int(input())
nums=list(map(int,input().split())) #打包为整型数组
for i in n……
编写题解 2835: 计算书费
摘要:解题思路:注意事项:参考代码:price=[28.9,32.7,45.6,78,35,86.2,27.8,43,56,65] #将价格储存进数组
nums=list(map(int,input().……