码迷,mamicode.com
首页 >  
搜索关键字:for while 列表索引 杨辉三角    ( 29291个结果
欧几里得算法求两个整数的最大公因数
unsigned int Gcd (unsigned int m,unsigned int n){ unsigned int rem; while(n>0){ rem = m % n; m = n; n = rem; } return...
分类:其他好文   时间:2014-07-16 23:18:24    阅读次数:497
c++11 thread
我看我们项目创建线程从来不join,detach#include #include #include #include void fun(){ while (true) { std::cout << "hehhe" << std::endl; }}int main()...
分类:编程语言   时间:2014-07-10 13:57:33    阅读次数:306
Can't locate Switch.pm in @INC
the perl version (5.14) shipped with 12.10 does not include the Switch.pm module needed while building WebKiT-GTK.How to install Perl Switch.pm modu.....
分类:其他好文   时间:2014-07-10 13:26:53    阅读次数:453
ARM汇编语言实现while循环
.section .data.output: .ascii "%d\n\000".section .text .global mainmain: mov ip, sp stmfd sp!, {fp,ip,lr,pc} sub fp, ip, #4 sub sp, sp, #80 @m...
分类:编程语言   时间:2014-07-10 13:11:49    阅读次数:950
剑指offer (46) 求1+2+3+...+n
题目:求1+2+3...+n,要求不能使用乘除法、for、while、if、else、switch、case等关键字以及条件判断语句题解分析:不能使用乘除法,也就不能使用 n(n+1)/ 2公式了不能使用for while 也就不能使用循环之类的利用构造函数求解:循环只是让相同代码重复执行n遍,我们...
分类:其他好文   时间:2014-07-10 11:33:22    阅读次数:208
《编程之美》之中国象棋将帅问题
一个将,一个帅,在各自的活动的9个格子里,但是两个人不能面对面,站在同一条直线上下面两种简单的解法#include int main(){ unsigned char i = 81; while (i--) { if (i / 9 % 3 == i % 9 % 3) continue; pr...
分类:其他好文   时间:2014-07-10 00:33:52    阅读次数:188
iOS: UIScrollView pauses NSTimer while scrolling
StackOverflowhttp://stackoverflow.com/a/7059499Question:I have aUIScrollViewthat has a series of labels which are rapidly updating numbers (every .06 ...
分类:移动开发   时间:2014-07-07 22:02:50    阅读次数:330
微博估计要火一阵的SleepSort之Shell及C实现
今日在微博看到如此神奇的代码,居然还有新的sort算法,对于我这种渣渣必须研究一下,代码如下: #!/bin.bash function f() { sleep "$1" //sleep 这么多ms echo "$1" } while [ -n "$1" ] //第一个参数不为空 do f "$1" & //后台运行,相当于fork一个进程去执行f, 父进程同...
分类:其他好文   时间:2014-06-30 08:41:57    阅读次数:256
C++ 显示星号密码
#include #include #include using namespace std; int main() { vector password; int len = 0; cout << "Enter password: "; while( true ){ char ch = getch(); if( ch == 1...
分类:编程语言   时间:2014-06-29 23:57:16    阅读次数:406
PAT(B) 101-111-1-2014-03-01
1.个位数统计: #include #include #include #include #include #include #include #include #include #include #include using namespace std; char s[1005]; int n, a[10]; int main(){ while(gets(s)) { memset(a,...
分类:其他好文   时间:2014-06-28 08:55:24    阅读次数:191
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!