age1 = 90 num = 1while num<=10: age = int(input("请输入您的年龄:")) if age == age1: print("正确,结束") num += 10 elif age > age1: print("年龄太大了!") else: age < age ...
分类:
其他好文 时间:
2020-06-30 22:29:01
阅读次数:
207
#!/bin/bash ms=`date +%-H%M` if ((10#$1 <= 10#$ms));then echo "future time,please" exit 0 fi while ((10#$1 != 10#$ms)) do ms=`date +%H%M` if ((10#$1-1 ...
分类:
其他好文 时间:
2020-06-30 20:56:18
阅读次数:
74
int prime[maxn], prime_tot; int is_prime[maxn]; int mu[maxn]; void pre_calc(int lim) { mu[1] = 1; for (int i = 2; i <= lim; i++) { if (!is_prime[i]) { ...
分类:
其他好文 时间:
2020-06-30 20:43:31
阅读次数:
49
Redis分布式锁 什么是分布式锁? 分布式CAP原则告诉我们,Consistency(一致性)、 Availability(可用性)、Partition tolerance(分区容错性),三者不可得兼。 在单机(单进程)环境中,JAVA提供了很多并发相关API,但在多机(多进程)环境中就无能为力了 ...
分类:
其他好文 时间:
2020-06-30 20:21:44
阅读次数:
47
传统Python语言的主要控制结构是for循环。然而,需要注意的是for循环在Pandas中不常用,因此Python中for循环的有效执行并不适用于Pandas模式。一些常见控制结构如下。 for循环 while循环 if/else语句 try/except语句 生成器表达式 列表推导式 模式匹配 ...
分类:
编程语言 时间:
2020-06-30 17:41:19
阅读次数:
65
图的遍历DFS 与树的深度优先遍历之间的联系 树的深度优先遍历分为:先根,后根 //树的先根遍历 void PreOrder(TreeNode *R){ if(R!=NULL){ visit(R); //访问根节点 while(R还有下一个子树T) PreOrder(T); //先根遍历下一棵子树 ...
分类:
其他好文 时间:
2020-06-30 14:54:31
阅读次数:
55
内存溢出以及堆栈溢出 简单认识一下2种内存异常OutOfMemoryError,StackOverflowError 来自JDK Doc的解释: public class OutOfMemoryError extends VirtualMachineError Thrown when the Jav ...
分类:
其他好文 时间:
2020-06-30 10:24:17
阅读次数:
51
字符串 ac自动姬 前言 省选临近,不能再颓了! 说着开始研究起moonlight串流。真香 本期博客之所以在csdn上发了一份,因为没有图床!如果有图床我一定会自力更生的! 好像和字符串没有毛关系 总之,为了备考省选,特地温习了一下ac自动姬 介绍 ac自动姬是一种多模匹配算法。说的直白一点,就是 ...
分类:
其他好文 时间:
2020-06-30 00:22:41
阅读次数:
75
一、技术总结 分三种情况: 当 二、参考代码 #include<iostream> using namespace std; int main(){ int n, a = 1, ans = 0; int left, now, right; cin >> n; while(n / a != 0){ l ...
分类:
其他好文 时间:
2020-06-29 23:08:00
阅读次数:
93
list1=[9,5,3,2,8,1] num = 0 while num < len(list1): 总共要循环的次数 for i in range(len(list1)-1): 第一轮比较挑选出一个最大值 if list1[i]<list1[i+1]: list1[i],list[i+1]=li ...
分类:
编程语言 时间:
2020-06-29 22:51:46
阅读次数:
65