叶花永不相见
叶花永不相见
全部文章
题解
归档
标签
去牛客网
登录
/
注册
叶花永不相见的博客
全部文章
/ 题解
(共50篇)
题解 | #魔法数字变换#
n = int(input()) cnt = 0 while n != 1: if n % 2 == 0: n = n // 2 cnt += 1 else: n = 3*n+1 cnt += 1 print(cnt)
Python3
2022-06-22
0
334
题解 | #牛牛学数列3#
n = int(input()) m = 0 s = 0 for i in range(1, n+1): m += (-1)**(i-1)*(2*i-1) s += 1/m print("%.3f" % s)
Python3
2022-06-18
0
290
题解 | #牛牛学数列#
n = int(input()) ji = 0 ou = 0 for i in range(1, n+1): if i % 2 == 0: ou += i else: ji += i print(ji-ou)
Python3
2022-06-18
0
286
题解 | #KiKi求质数个数#
for i in range(1,10): for j in range(1,i+1): print("%d*%d=%2d" % (j, i, i*j), end=" ") print()
Python3
2022-06-18
0
275
题解 | #奇偶统计#
n =int(input()) ji = 0 ou = 0 for i in range(1,n+1): if i % 2 == 0: ou += 1 else: ji += 1 print("%d %d" % (ji,ou))
Python3
2022-06-17
0
267
题解 | #[NOIP2008]ISBN号码#
a,b,c,d =input().split("-") num = ''.join([a,b,c]) sum = 0 j=1 for i in num: sum += int(i)*j j += 1 if sum % 11 == 10: s = "X" else: s...
Python3
2022-06-17
0
255
题解 | #小乐乐是否被叫家长#
a,b,c = map(int, input().split()) if (a+b+c)/3 >= 60: print("NO") else: print("YES")
Python3
2022-06-16
0
274
题解 | #获得月份天数#
while 1: try: y,m = map(int, input().split()) list = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] day = list[m] ...
Python3
2022-06-16
0
293
题解 | #计算一元二次方程#
while 1: try: a,b,c = map(float, input().split()) if a == 0: print("Not quadratic equation") else: ...
Python3
2022-06-16
0
261
题解 | #牛牛的计划#
y,***p(int, input().split()) y1,m1,d1 = map(int, input().split()) if y1>y : print("yes") elif y1==y and m1>=m and d1>=d: print("yes")...
Python3
2022-06-16
0
248
首页
上一页
1
2
3
4
5
下一页
末页