码迷,mamicode.com
首页 >  
搜索关键字:while break continue    ( 40024个结果
欧几里得算法求两个整数的最大公因数
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
span标签换行
span{word-break:normal;width:auto;display:block;white-space:pre-wrap;word-wrap:break-word;overflow:hidden;} white-space -- 通过HTML文档的源代码的排版方式控制页面显示文本的排...
分类:其他好文   时间:2014-07-10 00:07:38    阅读次数:332
【LeetCode】Word Break II
Word Break IIGiven a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word.Retur...
分类:其他好文   时间:2014-06-28 09:45:34    阅读次数:223
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
Summary: Binary Search
Iterative ways: 1 int binarySearch (int[] a, int x) { 2 int low = 0; 3 int high = a.length - 1; 4 int mid; 5 6 while (low x) {12 ...
分类:其他好文   时间:2014-06-27 22:27:06    阅读次数:361
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!