一、流程控制l顺序结构:默认的流程结构。按照书写顺序执行每一条语句。l选择结构:对给定的条件进行判断,再根据判断结果来决定执行哪一段代码。l循环结构:在给定条件成立的情况下,反复执行某一段代码。二、选择结构-if1.简单使用lif(表达式)语句1;uif(count>50)开班;上课;lif(表达式...
分类:
其他好文 时间:
2015-11-14 07:36:26
阅读次数:
272
Count and SayThe count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off as "one 1" or 11.11...
分类:
其他好文 时间:
2015-11-14 06:25:12
阅读次数:
266
string包:查找字串是否在指定的字符串中:strings.Contains("seafood","foo")//truestrings.Contains("seafood","bar")//false查找字串是在指定的字符串中出现的次数:strings.Count("cheese","e")//...
分类:
编程语言 时间:
2015-11-13 18:52:30
阅读次数:
216
count(1)与count(*)比较: 如果你的数据表没有主键,那么count(1)比count(*)快 如果有主键的话,那主键(联合主键)作为count的条件也比count(*)要快 如果你的表只有一个字段的话那count(*)就是最快的啦...
分类:
数据库 时间:
2015-11-13 18:26:08
阅读次数:
316
批量重命名脚步记录,以备用假如有一批11.txt 12.txt 13,txt 14.txt 15.txt脚步要要重命名为1.txt 2.txt 3.txt ....脚本如下:#!/bin/bashcount=1for i in *.txtdo new=$count.${i#*.} mv $i $ne...
分类:
系统相关 时间:
2015-11-13 17:07:27
阅读次数:
237
/*将二进制转换成十六进制*/class BinaryToHex { public static void main(String[] args) { int num = 120; char[] result = new char[1024]; int count = 0; while((...
分类:
其他好文 时间:
2015-11-13 17:05:56
阅读次数:
367
https://leetcode.com/problems/number-of-islands/Given a 2d grid map of'1's (land) and'0's (water), count the number of islands. An island is surrounde...
分类:
其他好文 时间:
2015-11-13 14:35:41
阅读次数:
220
1 --选出相同行 2 SELECT * 3 FROM I_KHXXGZSJWH a 4 WHERE ( ( SELECT COUNT(*) 5 FROM I_KHXXGZSJWH 6 WHERE KEHBM = a.KEHBM 7 ) > 1 ) 8 ORDER BY KEHBM DESC 9 ....
分类:
数据库 时间:
2015-11-13 14:29:00
阅读次数:
306
public class Solution { /** * @param num: an integer * @return: an integer, the number of ones in num */ /*** * Bit Opperati...
分类:
其他好文 时间:
2015-11-13 12:59:49
阅读次数:
209
//判断1000年---2000年之间的闰年#include<stdio.h>intmain(){intyear=0,count=0;for(year=1000;year<=2000;year++){ if((year%4==0)&&(year%100!=0)||(year%400==0)) { printf("%d",year); count=count+1;}}printf("\ncount=%d\n",count);return0;}//给定两..
分类:
编程语言 时间:
2015-11-13 06:45:19
阅读次数:
257