本文目录流程控制选择结构-if选择结构-switch循环结构-while循环结构-do while循环结构-forbreak 和 continue回到顶部一、流程控制1> 顺序结构:默认的流程结构。按照书写顺序执行每一条语句。2> 选择结构:对给定的条件进行判断,再根据判断结果来决定执行哪一段代码。...
分类:
其他好文 时间:
2014-07-03 22:21:27
阅读次数:
348
原文地址:用bash脚本读文件的方法有很多。请看第一部分,我使用了while循环及其后的管道命令(|)(cat $FILE | while read line; do …),并在循环当中递增 i 的值,最后,我得到了非我所想的 i 。主要的原因是,管道命令会发起子shell来读取文件,而任何在(子s...
分类:
其他好文 时间:
2014-07-03 21:57:53
阅读次数:
289
Default do not need username and password authenticate when access mongoDB ,I want to set up the user name & password for my mongoDB. so that any remo...
分类:
数据库 时间:
2014-07-03 21:02:37
阅读次数:
343
题目:Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space fo...
分类:
其他好文 时间:
2014-07-03 20:58:08
阅读次数:
248
Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.class Solution...
分类:
其他好文 时间:
2014-07-03 20:25:21
阅读次数:
219
Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.此题目有两种解决思路:1)递归...
分类:
其他好文 时间:
2014-07-03 20:07:01
阅读次数:
199
一:循环结构的四个要素:1.初始变量2.迭代变量3.循环条件4.循环操作(循环体)循环条件是一个表达式,它的值为boolean类型,要么true要么false.二:循环结构的基本语法:1.while循环结构while(循环条件){//循环操作(循环体)}特点:先判断循环条件是否满足,再执行循环操作!...
分类:
其他好文 时间:
2014-07-03 19:25:21
阅读次数:
205
迭代对于我们搞Java的来说绝对不陌生。我们常常使用JDK提供的迭代接口进行Java集合的迭代。 Iterator iterator = list.iterator(); while(iterator.hasNext()){ String string = iterator.next(); //do...
分类:
编程语言 时间:
2014-07-03 19:06:49
阅读次数:
191
在苹果的SDK中可以看到这两个都是定义的宏
NSAssert 的定义如下:
#define
NSAssert(condition, desc, ...)
do
{
__PRAGM...
分类:
其他好文 时间:
2014-07-03 16:08:07
阅读次数:
206
refer linkThe"*and"+registers are for the system's clipboard (:help registers). Depending on your system, they may do different things. For instance, ...
分类:
其他好文 时间:
2014-07-03 12:10:56
阅读次数:
195