海纳冰川,人纳天下,龙纳万物
海纳冰川,人纳天下,龙纳万物
全部文章
分类
题解(9)
归档
标签
去牛客网
登录
/
注册
海纳冰川,人纳天下,龙纳万物的博客
全部文章
(共29篇)
题解 | #重载运算#
import sys class Coordinate: def __init__(self,x,y) : self.x=x self.y=y def __str__(self): return f'({self.x}, {self...
2024-09-06
0
95
题解 | #球的表面积#
import sys import math s=[1, 2, 4, 9, 10, 13] # for i in s: # print('{:.2f}'.format(4*math.pi*i**2)) k=[i**2*4*math.pi for i in s] for i in k...
2024-09-05
0
92
题解 | #兔子的数量#
import sys k=int(input()) # s=list(range(1,11)) # s[0],s[1]=2,3 # for i in range(0,10): # if i>1: # s[i]=s[i-1]+s[i-2] # print(s[k-...
2024-09-05
0
105
题解 | #单词造句#
from contextlib import nullcontext import sys s=[] for i in iter(input,'0'): s.append(i) print(" ".join(s)) # while(1): # k=input(...
2024-09-05
0
94
题解 | #单词造句#
from contextlib import nullcontext import sys s=[] while(1): k=input() if k=='0': break else: print("".join(k)...
2024-09-05
0
87
题解 | #使用字典计数#
import sys str1=input() dict1={} for i in str1: if i not in dict1: dict1[i]=1 else: dict1[i]=dict1[i]+1 print(dict1)
2024-09-03
0
95
题解 | #字典新增#
import sys dict1={'a': ['apple', 'abandon', 'ant'], 'b': ['banana', 'bee', 'become'], 'c': ['cat', 'come'], 'd': 'down'} key1=input() value1=input()...
2024-09-03
0
82
题解 | #生成字典#
import syslist1=list(input().split())list2=list(input().split())dict1=dict(zip(list1,list2))# dict1={}# for i in range(len(list1)):# dict1[list1[i...
2024-09-03
0
85
题解 | #首都#
import sys cities_dict={'Beijing': {"Capital": 'China'}, 'Moscow': {"Capital": 'Russia'}, 'Paris': {&qu...
2024-09-03
0
97
题解 | #牛牛的矩阵相加#
import sys k=[list(range(1,4)),list(range(4,7)),list(range(7,10))] s=[] number=int(input()) for i in k: t=[num*number for num in i ] s.append...
2024-09-03
0
103
首页
上一页
1
2
3
下一页
末页