melon.
melon.
全部文章
分类
归档
标签
去牛客网
登录
/
注册
melon.的博客
全部文章
(共117篇)
题解 | #数位之和#
s = input() sum = 0 for i in s: sum += int(i) print(sum)
2023-02-16
1
193
题解 | #牛牛学数列4#
循环 n = int(input()) sum = 0 for i in range(1,n+1): for j in range(1,i+1): sum += j print(sum) 递龟 def a(n): # 通项公式 if n == 1: ...
2023-02-16
1
334
题解 | #牛牛学数列4#
def a(n): # 通项公式 if n == 1: return 1 return n + a(n-1) def s(n): # 前n项和 if n == 1: return 1 return a(n) + s(n-1) n ...
2023-02-16
1
294
题解 | #牛牛学数列2#
递龟 def f(n): if n == 1: return 1 return 1/n + f(n-1) n = int(input()) print(f'{f(n):.6f}') normal n = int(input()) sum = 0 for i in ...
2023-02-14
1
363
题解 | #牛牛学数列#
a = int(input()) b = a // 2 print(-b) if a % 2 == 0 else print(-b + a)
2023-02-14
1
198
题解 | #乘法表#
for i in range(1,10): for j in range(1,i+1): bullshit = str(i*j).rjust(2) print(f'{j}*{i}={bullshit}',end=' ') print()
2023-02-13
1
188
题解 | #KiKi求质数个数#
sum = 0 for i in range(100,1000): for j in range(2,i): if i % j == 0: break else: sum += 1 print(sum)
2023-02-13
1
241
题解 | #奇偶统计#
n = int(input()) a = int(n/2) if n % 2 == 0: print(a,a) else: print(a+1,a)
2023-02-13
1
222
题解 | #小乐乐求和#
n = int(input()) Sn = (n+n*n) / 2 print(int(Sn))
2023-02-13
1
283
题解 | #KiKi说祝福语#
def f(n): if n == 0: return print('Happy new year!Good luck!') return f(n - 1) n = int(input()) f(n)
2023-02-13
1
237
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页