码迷,mamicode.com
首页 >  
搜索关键字:for while until    ( 29426个结果
[ACM] POJ 3259 Wormholes (bellman-ford最短路径,判断是否存在负权回路)
Wormholes Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 29971   Accepted: 10844 Description While exploring his many farms, Farmer John has discovered a ...
分类:其他好文   时间:2014-07-15 12:40:21    阅读次数:341
hdu 1722--Cake
由题意推得结论:p+q-gcd(p,q); /* * hdu 1722--Cake * date 2014/7/15 * state AC */ #include #include using namespace std; /* int gcd(int x,int y) { while(x!=y) { if(x>y)x=x-y; else y...
分类:其他好文   时间:2014-07-15 10:32:39    阅读次数:184
【C++基础 03】do...while(0)妙用
我的主题是,有时候知道一些细节会让你写出更好的代码。...
分类:编程语言   时间:2014-07-15 10:26:52    阅读次数:225
二叉树的非递归遍历
先写下这个问题的模式 def preorderTraversal(self, root): if root == None: return [] re = [] insert root to stack s while s not empty: cur_root = top of stack s s.pop() how to handle cur_root how to ...
分类:其他好文   时间:2014-07-15 10:17:43    阅读次数:274
shell脚本不换行刷新数据
#!/bin/bash while[1]doa=$(ifconfigeth0|grep'RXpac'|awk'{print$2}'|awk-F:'{print$NF}')echo-ne"$a\r"#不换行刷新数据 doneecho参 数:-n 不要在最后自动换行 -e 若字符串中出现以下字符,则特....
分类:其他好文   时间:2014-07-15 09:43:48    阅读次数:191
please wait while windows configures microsoft visual studio professional 2013
VS3013安装update 2以后,打开offie出现“please wait while windows configures microsoft visual studio professional 2013”提示,每次打开都会有。解决办法:在C:\Windows\Microsoft.NET\...
分类:Windows程序   时间:2014-07-15 00:23:35    阅读次数:422
HDOJ1556 Color the ball 【线段树】+【树状数组】+【标记法】
10951071 2014-07-06 16:14:52 Time Limit Exceeded 1556 3000MS 584K 400 B G++ 长木 #include #include #define maxn 100000 + 2 int arr[maxn]; int main() { int n, a, b; while(scanf("...
分类:其他好文   时间:2014-07-14 18:12:43    阅读次数:264
你不知道的多重循环的事情
当你循环输入的时候我们有几种方法 一:while(scanf("%d %d",&a,&b)!=EOF)//>0//==1 反正有很多种,但是今天早上我用两个代码提交发现了问题 相同的算法但是第一个超时 #include #include #define max 1000000+10 #include using namespace std; int a[max]; int cmp(int...
分类:其他好文   时间:2014-07-14 16:46:36    阅读次数:201
shell编程(十二)--- 添加用户示例
[root@Server3Learn]#catuseradd-final.sh #!/bin/bash # DEBUG=0 ADD=0 DEL=0 help(){ echo"Usage:$(basename$0)-v|--verbose|--adduser1,user2,...|--deluser1,user2,...|-h|--help" } while[$#-ne0] do case$1in -h|--help) help exit0 ;; -v|--verbose) DEBUG=1 shi..
分类:其他好文   时间:2014-07-14 16:25:52    阅读次数:230
CTreeCtrl运用 遍历文件
CTreeCtrl运用删除无效资源递归的运用自写遍历目录函数递归遍历所有子目录一、删除无效资源 1、打开资源文件 2、找到无效链接删掉二、自写遍历目录函数 CFileFind findfile; int nfound=findfile.FindFile(dirpath); while(nfound)...
分类:其他好文   时间:2014-07-14 10:28:09    阅读次数:205
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!