码迷,mamicode.com
首页 >  
搜索关键字:while break continue    ( 40024个结果
linux shell脚本中流程控制语句 if 、for、while、case
linux shell脚本中流程控制语句 if、for、while、case 1、if语句 [root@centos7 test2]# ls test.sh [root@centos7 test2]# pwd /home/test2 [root@centos7 test2]# cat test.sh ...
分类:系统相关   时间:2021-04-22 16:20:40    阅读次数:0
while 循环初认识
#!/usr/bin/env python #-*- coding:utf-8 -*- num=0 while num<=10: print(num,end="\t") num +=1 print("**************************") num2=0 sum_all=0 whil ...
分类:其他好文   时间:2021-04-22 16:16:24    阅读次数:0
leetcode-二分查找相关
二分查找的基本框架 int binarySearch(int[] nums, int target) { int left = 0, right = ...; while(...) { int mid = left + (right - left) / 2; if (nums[mid] == tar ...
分类:其他好文   时间:2021-04-22 15:54:34    阅读次数:0
L1-071 前世档案 (20 分)
二进制水题~。 int n,m; int main() { cin>>n>>m; while(m--) { string s; cin>>s; int res=0; for(int i=0;i<s.size();i++) if(s[i] == 'n') res+=1<<(n-1-i); cout<< ...
分类:其他好文   时间:2021-04-22 15:39:34    阅读次数:0
【问题记录】pycharm控制台搜狗输入法输入中文逗号会自动变为英文逗号
#多维列表(嵌套列表) #[[姓名,年龄,工资],[姓名,年龄,工资],[姓名,年龄,工资],[姓名,年龄,工资]] #字符串:"姓名,年龄,工资"例如: "张三,30,2000" emp_list = [] while True: info = input("请输入员工信息:") if info ...
分类:其他好文   时间:2021-04-22 15:26:09    阅读次数:0
c语言中continue语句
c语言中continue语句;执行continue语句后,循环体的剩余部分就会被跳过。 例子; 1、原始程序。输出矩形。 #include <stdio.h> int main(void) { int i, j, height, width; puts("please input the heigh ...
分类:编程语言   时间:2021-04-22 15:24:21    阅读次数:0
c语言实现单链表的倒叙
bool upsidedown_list(LinkList L) { Lnode *head, *tmp, *oldhead; head = L; tmp = L->next; oldhead = L; while (tmp) { oldhead->next = tmp->next; tmp->ne ...
分类:编程语言   时间:2021-04-22 15:16:52    阅读次数:0
并查集Union-find的优化问题
并查集可以有两个优化方案, 1,平衡性优化:对每个结点标记一个重量值,在进行union操作时,将重量小的添加到重量大的节点上。 2,路径压缩:在进行find操作时,顺便对路径进行压缩 private int find(int x) { while (parent[x] != x) { // 进行路径 ...
分类:其他好文   时间:2021-04-22 15:12:28    阅读次数:0
链表反转实现
方法一:双指针法 采用就地反转,不用额外开辟空间 注意:接收链表的head节点,返回当前节点 方法二:递归法 代码如下: class Node(object): def __init__(self, item, next=None): self.item = item self.next = nex ...
分类:其他好文   时间:2021-04-21 12:23:41    阅读次数:0
linux 监控服务器流量
linux 监控服务器流量 #!/bin/bash ethn=$1 while true do RX_pre=$(cat /proc/net/dev | grep $ethn | sed 's/:/ /g' | awk '{print $2}') TX_pre=$(cat /proc/net/dev ...
分类:系统相关   时间:2021-04-21 12:03:54    阅读次数:0
40024条   上一页 1 ... 25 26 27 28 29 ... 4003 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!