燕草如碧
燕草如碧
全部文章
分类
题解(60)
归档
标签
去牛客网
登录
/
注册
燕草如碧的博客
全部文章
(共66篇)
题解 | #数字三角形#
还是f提前舒服 def print_pic(n): for i in range(1,n+1): for j in range(1,n+1): if j<=i: print(f"{j} ",end="") ...
Python3
2022-06-20
0
238
题解 | #空心三角形图案#
从1到N遍历比从0到N遍历还是好理解一些 n = int(input()) for i in range(1,n+1): for j in range(1,n+1): if j==1 or j==i or i==n: print("* ",end=""...
Python3
2022-06-20
0
220
题解 | #空心正方形图案#感觉很难
感觉很难 while 1: try: n = int(input()) for i in range(0,n): for j in range(0,n): if i==0 or i ==n-1: ...
Python3
2022-06-20
0
240
题解 | #X形图案#
比较喜欢用0到n的循环 while 1: try: n = int(input()) for i in range(0,n): for j in range(0,n): if i==j or j==(n-...
Python3
2022-06-20
0
231
题解 | #反向输出一个四位数#难!!!!!
感觉很难 while 1: try: n = int(input()) for i in range(0,n): print(" "*(n-i-1),end="") print("* "*(i+1)) e...
Python3
2022-06-20
0
230
题解 | #水仙花数#
还算比较敢单 while 1: try: m,n = map(int,input().split()) flag = [] for i in range(m,n+1): sum1=0 add = ...
Python3
2022-06-17
0
290
题解 | #小乐乐算多少人被请家长#
没啥营养 n = int(input()) count = 0 for i in range(1,n+1): a = list(map(int,input().split())) if(sum( a)/len(a))<60: count+=1 print(co...
Python3
2022-06-17
0
223
题解 | #包含数字9的数#
感感单单 count =0 for i in range (1,2020): for j in str(i): if j == '9': count+=1 break print(count)
Python3
2022-06-17
0
256
题解 | #牛牛学数列4#
吸取楼上的解法,更易懂了. n = int(input()) print(sum([sum([i for i in range(1,i+1)])for i in range(1,n+1)])) 内外循环更容易看懂
Python3
2022-06-17
0
188
题解 | #牛牛学数列2#so easy
n = int(input()) sum=0.0 for i in range(1,n+1): sum += 1/i +0.0000000000000000001 print(f"{sum:.6f}")
Python3
2022-06-17
0
289
首页
上一页
1
2
3
4
5
6
7
下一页
末页