/*高级for循环*/ //这个叫守卫 for(i <- 1 until 10 if i%3==0){ //修改步长 println(i) } for(i <- 1 until 10; if i%3==0){ //修改步长.其实是有个分号的 println(i) } //写法1:嵌套for循环 fo... ...
分类:
其他好文 时间:
2017-10-31 00:37:14
阅读次数:
295
上篇我们学习了shell中条件选择语句的用法。接下来本篇就来学习循环语句。在shell中,循环是通过for, while, until命令来实现的。下面就分别来看看吧。 for for循环有两种形式: for-in语句 基本格式如下: list代表要循环的值,在每次循环的时候,会把当前的值赋值给va ...
分类:
系统相关 时间:
2017-10-28 11:14:53
阅读次数:
202
看眼缘随机拿了一道不难的题https://leetcode.com/problems/add-digits/description/ Given a non-negative integer num, repeatedly add all its digits until the result ha ...
分类:
其他好文 时间:
2017-10-27 23:05:50
阅读次数:
159
using System; using System.Windows.Forms; using System.Drawing; using System.Collections; namespace ListViewSortFormNamespace { public class ListViewS ...
if 单格式与嵌套 多分支格式 case while /until 下面将这个程序再改动一下 for 枚举用法 文件用法 累加格式 其他循环控制语句 break 命令不执行当前循环体内break下面的语句从当前循环退出. continue 命令是程序在本循体内忽略下面的语句,从循环头开始执行. 判断 ...
分类:
系统相关 时间:
2017-10-25 00:33:14
阅读次数:
235
Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the process is like: ...
分类:
其他好文 时间:
2017-10-24 20:53:00
阅读次数:
172
while循环,使您能够重复执行一组命令,直到某些条件发生。它通常用于当你需要反复操纵的变量值。 语法 这里Shell命令进行计算。如果结果值是 true,给定语句被执行。如果命令为 false,那么没有语句将不执行,程序将跳转到done语句后的下一行。 例子: 下面是一个简单的例子,使用while ...
分类:
系统相关 时间:
2017-10-24 17:17:10
阅读次数:
235
事情的原委: 今天遇到一个问题:一个数据表case_folder_info想要实现自定义排序功能,就在表里新加了一个字段SORT_NUMBER,由于表里存在已有数据,所以这个SORT_NUMBER字段都为空,但要想实现上移、下移、置顶等功能的话,需要里面有默认数据,所以我想给这个字段里默认有一些排序 ...
分类:
数据库 时间:
2017-10-24 00:14:52
阅读次数:
290
Write an algorithm to determine if a number is "happy". A happy number is a number defined by the following process: Starting with any positive intege ...
分类:
移动开发 时间:
2017-10-20 21:46:44
阅读次数:
251
Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the process is like: ...
分类:
其他好文 时间:
2017-10-20 21:38:54
阅读次数:
172