前面已经说过选择结构了其实他和for相差不是太大,现在就来说说循环结构。循环结构有三种形式!1
for 2.while 3.do while 这三种都可以循环,不过他们之间还是有区别的,for和while是要先验证条件,如果条件满足才执行循环体,而后者do
while是不管条件是否满足都要执...
分类:
其他好文 时间:
2014-05-10 20:03:50
阅读次数:
326
1)循环语句while,do/while,for
格式:while(布尔表达式){循环体语句}//先验循环,可执行0次或n次,若布尔表达式第一次为false,永不执行循环体语句
do{循环体语句}while(布尔表达式);//后验循环,可执行一次或n次,且至少执行一次 for(初始化;布尔表达式;变...
分类:
其他好文 时间:
2014-05-06 09:15:17
阅读次数:
254
http://blog.sina.com.cn/s/blog_7a4cdec80100wkyh.html
分类:
其他好文 时间:
2014-05-05 23:53:37
阅读次数:
314
Link:http://oj.leetcode.com/problems/reverse-linked-list-ii/Reverse a linked
list from positionmton. Do it in-place and in one-pass.For example:Given1...
分类:
其他好文 时间:
2014-05-05 22:46:11
阅读次数:
411
题目链接:
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5176
Simple Equation
Time Limit: 2 Seconds Memory Limit: 65536 KB
There are many Equations. Some are difficu...
分类:
其他好文 时间:
2014-05-03 17:47:01
阅读次数:
343
sed‘s/^/\//g‘4行首增加指定字符提取网页中的播放地址:#!/bin/bash
printf"enteryourdir:"
readdir
echo"$dirisxx"
cd$dir
echo`pwd`
forfilein`ls.`
do
if[-d$file];then
echo$file
cd$file
echo`pwd`
tree`pwd`|grepplay|sed‘s/.*//g‘>11
tree`pwd`|grepplay|sed‘s/.*//g..
分类:
其他好文 时间:
2014-05-03 00:53:15
阅读次数:
336
题目链接:
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3749
Chameleon
Time Limit: 6 Seconds Memory Limit: 65536 KB
Given n groups of integers(all the integers are distin...
分类:
其他好文 时间:
2014-05-02 19:06:34
阅读次数:
447
“参考Lua游戏开发实践指南”
Lua提供两种控制结构(数字型和通用型)--Lua中的for语句的索引是从1开始的 数字型: 一个简单的示例如下1 for indx = 1, 10 do2
print(indx)3 end do关键字标记程序块的开始,end标记程序块的结束。 ...
分类:
其他好文 时间:
2014-05-02 17:26:51
阅读次数:
702
Reverse a linked list from positionmton. Do it
in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m=
2 andn= 4,return1->4->3->2->5->NULL.No...
分类:
其他好文 时间:
2014-05-02 09:10:46
阅读次数:
252
- (void)viewDidLoad{ [super viewDidLoad]; // Do any
additional setup after loading the view, typically from a nib. [NSThread
sleepForTimeInte...
分类:
移动开发 时间:
2014-05-02 00:25:42
阅读次数:
441