神奇的追梦人就要上岸了
神奇的追梦人就要上岸了
全部文章
分类
归档
标签
去牛客网
登录
/
注册
神奇的追梦人就要上岸了的博客
全部文章
(共42篇)
题解 | 截断电话号码
import re x = input() print(re.match("[0-9|-]*",x).group())
2025-07-02
0
29
题解 | 提取数字电话
import re x = input() print(re.sub(pattern=r"[^\d]", repl="",string = x)) re.sub(r"[^\d]+", "", x) 或 re.finda...
2025-07-02
0
27
题解 | 重载运算
class Coordinate(object): def __init__(self, x, y): self.x = x self.y = y def __str__(self): return f"({self.x},...
2025-07-02
0
29
题解 | 修改属性1
class Employee: def __init__(self, name, salary): self.name = name self.salary = salary def printclass(self): try: ...
2025-07-02
0
49
题解 | 班级管理
class P: def __init__(self) -> None: self.name = input() self.id = input() self.score = int(input()) self.grade...
2025-07-02
0
24
题解 | 球的表面积
from math import pi def cal(r): s = 4*pi*r**2 s = round(s, 2) return s x = [1, 2, 4, 9, 10, 13] for i in x: print(cal(r=i),end = &q...
2025-07-02
0
35
题解 | 兔子的数量
n = int(input()) a=[] for i in range(n): if i==0: a.append(2) elif i==1: a.append(3) else: a.append(a[i-2] + a[i-...
2025-07-02
0
35
题解 | 创建集合
x = set(input().split(" ")) print(sorted(x)) 注意,set是无序、不存在重复元素的结构!
2025-06-27
0
43
题解 | 单词造句
lines = [] while True: try: line = input() if line == "0": # 空行表示结束 break lines.append(line) ex...
2025-06-27
0
41
题解 | 子串的数量
c = input() print(c.count("Niu"))
2025-06-27
0
25
首页
上一页
1
2
3
4
5
下一页
末页