本次重点:data步循环与控制
涉及:if/then/else语句,select语句,do语句,continue语句,leave语句
1.if then else 语句
高效率的if应用:
1)
If x=1 then y=1;
Else if x=2 then y=2;
Else y=3;
对于每一个数据集的观测,if-then-else只会判...
分类:
其他好文 时间:
2014-09-28 10:49:01
阅读次数:
265
if s[i] = t[j] then
d[i, j] := d[i-1, j-1] // no operation required
else
d[i, j] := minimum(
d[i-1, j] + 1, // a deletion
d[i, j-1] + 1,...
分类:
其他好文 时间:
2014-09-27 23:36:40
阅读次数:
179
1. Basic Regular Expression a. "^" matching the head of a line. "^" must be the first character in a regular expression ,else it only a common ch...
分类:
其他好文 时间:
2014-09-27 19:08:30
阅读次数:
160
例子:1 i = 12 while i < 10:3 print(i)4 i+=15 else:6 print('finish')输出1至9和finish在while语句中同样支持for语句所支持的continue、break和else
分类:
编程语言 时间:
2014-09-27 15:21:59
阅读次数:
146
<?php
//?晕大海?2014.09.26
define("TOKEN",?"weixin");
$wechatObj?=?new?wechatCallbackapiTest();
if(!isset($_GET["echostr"])){
?????$wechatObj->responseMsg();
}else{
?$wechatObj->val...
分类:
微信 时间:
2014-09-27 14:49:40
阅读次数:
429
Python的分支语句比较简单,只有if、else、elif三个关键字,也就是说,Python没有switch语句,而且,Python中并没有?:这个三目运算符。例子:1 age = 182 if age < 18:3 print('too young')4 elif age == 18:5...
分类:
编程语言 时间:
2014-09-27 03:53:39
阅读次数:
183
#includechar A[10];void inputElem(char &e){ scanf("%c",&e);}bool endValue(char &e){ if(e!='#') return false; else return tr...
分类:
其他好文 时间:
2014-09-26 22:53:58
阅读次数:
203
1) CASECASE有两种使用形式:一种是简单的CASE函数,另一种是搜索型的CASE函数。[1]简单的 CASE 函数Format:CASE input_expression WHEN when_expression THEN result_expression [ ...n ] [ ELSE ...
分类:
数据库 时间:
2014-09-26 21:45:48
阅读次数:
317
(function () {debugger;if(true) { var i = 100;}else { i = 10;}})();
分类:
编程语言 时间:
2014-09-26 20:41:58
阅读次数:
151
Implement pow(x, n).
public class Solution {
public double pow(double x, int n) {
if(n>0) return powInt(x,n);
else return 1/powInt(x,-n);
}
private double powInt(double x, int n){
if...
分类:
其他好文 时间:
2014-09-26 20:00:48
阅读次数:
112