chen_f
chen_f
全部文章
分类
题解(16)
归档
标签
去牛客网
登录
/
注册
chen_f的博客
全部文章
(共15篇)
题解 | #查找组成一个偶数最接近的两个素数#
n= float(input()) x=1 while abs(x**3-n)>1e-7: x=x-(x**3-n)/(3*x**2) print(round(x,1)) 损失函数:loss=x**3-n 步长为:函...
2021-08-25
0
388
题解 | #密码强度等级#
描述Python strip() 方法用于移除字符串头尾指定的字符(默认为空格)或字符序列。 注意:该方法只能删除开头或是结尾的字符,不能删除中间部分的字符。 语法strip()方法语法: str.strip([chars]);参数chars -- 移除字符串头尾指定的字符序列。返回值返回移除字符串...
2021-08-24
0
390
题解 | #统计大写字母个数#
while True: try: a = 0 s = input() for i in s: if i.isupper(): a += 1 print(a) exc...
2021-08-24
0
427
题解 | #尼科彻斯定理#
while True: try: num = int(input()) s = 1 t = [] for i in range(num): s = s + 2 * i t.append(...
2021-08-24
0
362
题解 | #公共子串计算#
while True: try: str_1=input() ...
2021-08-24
7
642
题解 | #参数解析#
while True: try: a = input().split() b = [] i = 0 while i < len(a): if a[i][0] != '"' and a[i]...
2021-08-24
0
387
题解 | #计算日期到天数转换#
n = input().split() n[0] = int(n[0]) n[1] = int(n[1]) n[2] = int(n[2]) x = 0 m = [31,28,31...
2021-08-24
0
401
题解 | #统计每个月兔子的总和#
while True: try: month = int(input()) &...
2021-08-24
0
363
题解 | #四则运算#
print(int(eval(input().replace('{','(').replace('}',')').replace('[','(').replace(']',')')))) 描述 eval() 函数用来执行一个字符串表达式,并返回表达式的值。 语法 ...
2021-08-24
0
346
题解 | #删除字符串中出现次数最少的字符#
while True: try: a = input() li = {} for i in a : li[i] = a.count(i) b = sorted(li.values()) f...
2021-08-23
0
322
首页
上一页
1
2
下一页
末页