码迷,mamicode.com
首页 >  
搜索关键字:for while until    ( 29426个结果
ACdream ????计算最长连续相同字符的个数
计算最长连续相同字符的个数 测试数据 输入: aaaassdfg adasafag ssddffffgt 输出: 4 1 4   #include #include int main() { int i,n,t; int b[105]; char a[105]; scanf("%d",&t); while(t--) { ...
分类:其他好文   时间:2014-06-11 06:40:08    阅读次数:207
uva Children's Game
非常巧妙的题目,巧用cmp,注意cmp的重载 #include #include using namespace std; string a[55]; bool cmp(string a, string b){ return a+b > b+a; } int main(int argc, char const *argv[]) { int n; while(cin >...
分类:其他好文   时间:2014-06-11 06:10:28    阅读次数:293
一入python深似海--while-loop与for-loop
while loops 定义与实例 i = 0 numbers = [] while i < 6: print "At the top i is %d" % i numbers.append(i) i = i + 1 print "Numbers now: ", numbers print "At the bottom i is %d" % ...
分类:编程语言   时间:2014-06-11 00:59:17    阅读次数:410
Android多线程研究(9)——线程锁Lock
在前面我们在解决线程同步问题的时候使用了synchronized关键字,今天我们来看看Java 5.0以后提供的线程锁Lock.Lock接口的实现类提供了比使用synchronized关键字更加灵活和广泛的锁定对象操作,而且是以面向对象的方式进行对象加锁。 @Override public void run() { while(true){ Lock lock = new Re...
分类:移动开发   时间:2014-06-11 00:57:51    阅读次数:329
拓扑排序模版
bool Topo() { int sum = 0; while(1) { queue Q; for(int i = 1; i <= n; i++) if(!in[i]) Q.push(i); sum += Q.size(); if(sum == n) return true; if(!Q.size()) return false; whi...
分类:其他好文   时间:2014-06-10 13:29:29    阅读次数:236
Hdu1001
常规算法: 1 #include 2 int main() 3 { 4 // 常规算法 5 int a; 6 while(scanf("%d",&a)!=EOF){ 7 int i=0,sum = 0; 8 for(i;iint main(){...
分类:其他好文   时间:2014-06-10 12:39:37    阅读次数:284
C++ 异步IO (一) 阻塞式HTTP客户端
An IO call issynchronousif, when you call it, it does not return until the operation is completed, or until enough time has passed that your network s...
分类:编程语言   时间:2014-06-10 10:07:56    阅读次数:273
JavaScript基础
JavaScript 是一种解释性的基于对象的脚本语言。 JavaScript 语言使用的语法与 C 语言使用的语法类似,并支持结构化构造,例如if...else、for和do...while。大括号 ({}) 用于分隔语句块。该语言支持各种数据类型,包括String、Number、Boole...
分类:编程语言   时间:2014-06-10 08:50:04    阅读次数:284
POJ 3370 Halloween treats 鸽巢原理 解题
Halloween treats 和POJ2356差不多。 其实这样的数列可以有很多,也可以有不连续的,不过利用鸽巢原理就是方便找到了连续的数列,而且有这样的数列也必定可以找到。 #include #include #include int main() { int c, n; while (scanf("%d %d", &c, &n) && c) { int *nei...
分类:其他好文   时间:2014-06-10 06:02:58    阅读次数:293
hdu1000
1 #include 2 // 主函数main 3 int main() 4 { 5 int a,b; 6 // 在while循环中以EOF作为文件结束标志 7 // ASCII代码值的范围是0~255,不可能出现-1,因此可以用EOF作为文件结束标志 8 whil...
分类:其他好文   时间:2014-06-10 00:42:55    阅读次数:284
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!