摘要: #include<stdio.h> #include<stdio.h> #define MaxNameLen 100 typedef struct TreeNode{ char* name; Struct TreeNode* left_child; Struct TreeNode* right_ch 阅读全文
posted @ 2021-01-02 22:49 三天乐趣 阅读(185) 评论(0) 推荐(0) 编辑
摘要: dir0=[[0,1],[1,0],[0,-1],[-1,0]] step = 999999999 tempStep = 0 tempValue = 0 def grid_input(N): grid = [[]for i in range(N)] for i in range(N): line = 阅读全文
posted @ 2021-01-02 21:36 三天乐趣 阅读(338) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<vector> using namespace std; vector<char>post,in; vector<char>level(100000,-1); in N; void ergodic(int root,int start,int 阅读全文
posted @ 2021-01-02 16:14 三天乐趣 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 1、判断字符串长度、最长的表达式 """ 1、所有数字,计算长度不能超过long 2、如果有多个长度一样,请返回第一个表达式结果 3、数学表达式必须要是最长的,合法的 4、操作符不能是连续的,如 +--+1是不合法的 """ import re s = input("请输入字符串:") #保留只有0 阅读全文
posted @ 2021-01-02 14:58 三天乐趣 阅读(1419) 评论(0) 推荐(0) 编辑
摘要: """ 输入字符串,判断只包含数字、a-z、A-Z、+-的数字串,进行+-,算出最小和 """ import re def sum_s(s): sum = 0 if re.match('^[0-9a-zA-Z+-]+$',s):#判断只包含数字、a-z、A-Z、+-的数字串 list1 = re.f 阅读全文
posted @ 2021-01-02 13:52 三天乐趣 阅读(820) 评论(0) 推荐(0) 编辑
摘要: """ 输入字符串,判断只有括号,且括号配对,求出最深的括号深度 """ def s_true(s): sl = len(s) if sl < 1:#字符长度不能小于1 return False elif sl%2!=0:#字符长度要成双 return False c = 0 while c < s 阅读全文
posted @ 2021-01-02 12:04 三天乐趣 阅读(420) 评论(0) 推荐(0) 编辑