#此题可以只查找对的选项输出即可,没必要循环。 代码如下: #include<iostream> #include<stdio.h> using namespace std; int main() { string s; while (cin >> s) if(s.size() == 3 && s[ ...
分类:
其他好文 时间:
2020-07-20 10:34:10
阅读次数:
58
python实现快速排序,其主要的思想仍在递归的思想,如果能熟练掌握递归思想,这个排序过程也能熟练掌握 ...
分类:
编程语言 时间:
2020-07-20 10:32:18
阅读次数:
59
单例:用于使用同一份实例(对象) 单例模式的实现: 1、方案一: class Foo: def __init__(self, name, age): self.name = name self.age = age def show(self): print(self.name, self.age) ...
分类:
编程语言 时间:
2020-07-19 23:52:16
阅读次数:
75
灵性建图,Pick定理证明内向树森林,DFS时线段树统计线段覆盖 ...
分类:
其他好文 时间:
2020-07-19 23:49:58
阅读次数:
97
1. 使用while循环输出1 2 3 4 5 6 8 10count = 0while count < 10: count += 1 if count == 7 or count == 9: continue print(count)2.求1-100的所有数的和 num = 0count = 1w ...
分类:
其他好文 时间:
2020-07-19 23:45:36
阅读次数:
86
##题目 Pasha loves to send strictly positive integers to his friends. Pasha cares about security, therefore when he wants to send an integer n, he encry ...
分类:
其他好文 时间:
2020-07-19 23:37:51
阅读次数:
80
在用户权限下docker 命令需要 sudo 否则出现以下问题: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http:/ ...
分类:
其他好文 时间:
2020-07-19 23:34:49
阅读次数:
95
create function uf_findx (@text nvarchar(max),@find_x varchar(200),@find_n int)returns intasbegin --第n位无效参数返回0 if @find_n<1 return (0); --字符串不含指定字符串返回 ...
分类:
其他好文 时间:
2020-07-19 23:11:26
阅读次数:
79
归并排序 归并排序介绍**:归并排序(MERGE-SORT)是利用归并的思想实现的排序方法,该算法采用经典的分治(divide-and-conquer)策略(分治法将问题分(divide)成一些小的问题然后递归求解,而治(conquer)的阶段则将分的阶段得到的各答案"修补"在一起,即分而治之)。* ...
分类:
编程语言 时间:
2020-07-19 17:52:55
阅读次数:
58
[编程题] lc:344. 反转字符串 题目描述 输入输出例子 方法1:前后指针 Java代码 //方法1:前后指针的交换元素 public void reverseString1(char[] s) { int l = 0; int r = s.length-1; while(l<=r){ cha ...
分类:
编程语言 时间:
2020-07-19 16:11:37
阅读次数:
57