一、顺序语句从上到下依次执行二、分支语句1、if语句A、if(条件){满足条件执行}B、if(条件){满足条件执行}else{不满足条件执行}C、if(条件1){满足条件1执行}else if(条件2){不满足条件1,但满足条件2时执行}D、if(条件1) { if(条件2) {在满足条件1的情况....
/*css reset code *//**** 文字大小初始化,使1em=10px *****/body {font-size:62.5%;} /* for IE/Win */html>body {font-size:15px;} /* for everything else *//*字体边框等....
分类:
Web程序 时间:
2015-07-07 19:07:49
阅读次数:
177
#include int sum(int x,int y){ return x+y;}void printNum(int x){ //判断x的值 if (x>0) { printf("%d\t",x); }else{ printf("0\t"); ...
分类:
编程语言 时间:
2015-07-07 19:07:14
阅读次数:
155
一、语句分类:1.顺序语句2.分支语句if语句、switch语句3.循环语句(1)初始条件(2)循环条件(3)循环体(4)状态改变二、if语句:1.if语句4中情况:if(条件){满足条件的时候执行;}if(条件){满足条件执行;}else{不满足条件时执行;}if(条件1){满足条件1的时候执行;...
分类:
其他好文 时间:
2015-07-07 18:32:46
阅读次数:
99
NothingNothing是所有类型的子类,也是Null的子类。Nothing没有对象,但是可以用来定义类型。例如,如果一个方法抛出异常,则异常的返回值类型就是Nothing(虽然不会返回) 。
def get(index:Int):Int = {
if(x < 0) throw new Exception(...)
else ....
}if语句是表达式,有返回值,必然有返回值...
分类:
其他好文 时间:
2015-07-07 17:13:56
阅读次数:
192
drop procedure if exists p_hello_world;create procedure p_hello_world(in v_id int)begin if (v_id > 0) then select '> 0'; elseif (v_id = 0...
分类:
数据库 时间:
2015-07-07 12:42:09
阅读次数:
179
create function 函数名 (@pno int) returns int as begin declare @a int if not exists(select * from person where pno=@pno) set @a=-1 else set @a=1 return @...
分类:
数据库 时间:
2015-07-07 12:41:44
阅读次数:
134
要点汇总:一般性问题方法名称应该准确表达其具体行为
比如:Date newDate = date.add(5)//加5天?5个月?最好使用addDaysTo 或increaseByDays 明确方法的行为。
使用多态 代替 switch或if else
比如:
class RequestHandler { public void handleRequest(int action) {...
分类:
其他好文 时间:
2015-07-07 09:32:56
阅读次数:
149
人生最美好的东西,就是他同别人的友谊。——林肯
(define set?
(lambda (l)
(cond
((null? l) #t)
((member? (car l) (cdr l)) #f)
(else (set? (cdr l))))))
(set? '(apples peaches pear plums))
(set? '(ap...
分类:
其他好文 时间:
2015-07-07 00:55:57
阅读次数:
130
#include
void move(char x,char y)
{
printf("%c->%c\n",x,y);
}
//将n个盘子从1中借助2移动到3
void hanoi(int n,char one,char two,char three)
{
if(n==1)
move(one,three);
else
{
hanoi(n-1,one,two,three);
mo...
分类:
其他好文 时间:
2015-07-06 21:46:33
阅读次数:
111