码迷,mamicode.com
首页 >  
搜索关键字:do ... while 循环    ( 74622个结果
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
如何快速批量创建文本文档?
在要创建文档的文件夹里新建一个文本文档。 打开该文档,把下面的命令复制粘贴进去。 命令: @echo off for /L %%x in (1,1,10) do @echo %%x>%%x.txt 按下ctrl+S键保存该内容后,关闭该文档。 选择该文档,按下f2键进行重命名。把后缀名改为bat。 ...
分类:其他好文   时间:2021-04-22 15:18:09    阅读次数: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
Spring循环依赖
基本概念: 两个或两个以上的类相互引用、互相依赖; Java使用构造器不能解决循环依赖问题; Java可以使用setter解决循环依赖问题; Spring中: 内部通过三级缓存来解决循环依赖问题(DefaultSingletonBeanRegistry) 只有单例的 bean 会通过三级缓存提前暴露 ...
分类:编程语言   时间:2021-04-21 12:40:09    阅读次数:0
[vbs] 定时关闭进程代码
Dim bag,pipe do Set bag=GetObject("WinMgmts:") Set pipe=bag.execquery("select * from win32_process where name='notepad.exe'") for each i in pipe i.ter ...
分类:系统相关   时间:2021-04-21 12:36:32    阅读次数:0
数组去重
第一种:用indexOf方法 这种方法最简单最直观,也最容易理解,代码如下: 1 var arr = [2, 8, 5, 0, 5, 2, 6, 7, 2] 2 var newArr = [] 3 for (var i = 0; i < arr.length; i++) { 4 if (newArr ...
分类:编程语言   时间:2021-04-21 12:27:04    阅读次数:0
链表反转实现
方法一:双指针法 采用就地反转,不用额外开辟空间 注意:接收链表的head节点,返回当前节点 方法二:递归法 代码如下: class Node(object): def __init__(self, item, next=None): self.item = item self.next = nex ...
分类:其他好文   时间:2021-04-21 12:23:41    阅读次数:0
74622条   上一页 1 ... 39 40 41 42 43 ... 7463 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!