码迷,mamicode.com
首页 >  
搜索关键字:if then else    ( 23991个结果
关于 折半查找 while 条件 < , <=
int bin_search(int a[],int len,int key) {     int low=0; int high=len-1; while(low //体 不执行。 {  int mid=low+(high-low)/2; if(a[mid]==key) return mid; else if(a[mid] low=mid+1; else high=mi...
分类:其他好文   时间:2014-10-19 14:19:27    阅读次数:147
PHP 开发API接口 注册,登录,查询用户资料
服务端 0) { exit(json_encode(1)); //返回1表示注册失败 } else { $addsql = "insert into `member` (username,password,email) values ('$u...
分类:Windows程序   时间:2014-10-19 14:15:44    阅读次数:304
Python Errors and Exceptions
1. python中的try{}catch{}2. raise exception3. try...except ... else..4. finally块python中的异常处理的keyword和c#中的是不同样的,python中使用try,except关键在来处理异常,例如以下:2. raise...
分类:编程语言   时间:2014-10-19 11:32:07    阅读次数:228
POJ 1458 Common Subsequence
题意:求LCS Sol:经典的 LCS。 if ( i==0  || j==0 )  dp [ i , j ] = 0 ; else if ( X[ i ] == Y [  j ] ) dp [ i-1 , j-1 ] + 1; else dp [ i, j ] = max  (  dp[ i - 1 , j ] , dp [ i ,  j-1 ] )  #include #i...
分类:其他好文   时间:2014-10-18 21:01:51    阅读次数:203
编译器--支持条件语句和循环语句的计算器(三)
在上篇文章中实现了支持变量和赋值语句的计算器,这次加入了条件语句和循环语句。     语法简介 下面是条件语句的一个例子,能够对条件语句的格式有一个感性认识: if  var1 > 5 then  var2 := 10; end 条件语句以if开始,后跟一个条件表达式,如果其为真则执行then后面的语句块,条件语句以end结束。 条件语句也可以支持else分支语句,比如 if v...
分类:其他好文   时间:2014-10-18 18:25:42    阅读次数:333
VC网络连接判断API
bool isConnect; DWORD dw; isConnect = ::IsNetworkAlive(&dw);if(isConnect) cout << "IsNetworkAlive连接" <<endl; else cout << "IsNetworkAlive未连接"...
分类:Windows程序   时间:2014-10-18 16:42:36    阅读次数:170
Delphi判断一个字符是否为汉字的最佳方法
//判断字符是否是汉字 function IsHZ(ch: WideChar): boolean; var i:integer; begin i:=ord(ch); if( i40869) then result:=false else result:=true; ...
分类:Windows程序   时间:2014-10-18 15:23:55    阅读次数:281
编写宏的有效方法
【e良师益友网?】在编写宏的时候或许会存在一些问题,比如通常的目标是书写一个包含单独的函数调用语句的宏。这意味着“调用者” 需要提供最终的分号, 而宏体则不需要。因此宏体不能为简单的括弧包围的复合语句, 因为如果这样, 调用的时候就会发生语法错, 就像在if/else 语句的if 分支中多了一个el...
分类:其他好文   时间:2014-10-18 11:05:11    阅读次数:160
Codeforces Round #273 (Div. 2)
A题1 s = sum(map(int, raw_input().split()))2 print s / 5 if s % 5 == 0 and s / 5 else -1B题1 n, m = map(int, raw_input().split())2 div, lft = n / m, n %...
分类:其他好文   时间:2014-10-17 23:14:51    阅读次数:347
window.onload兼容问题
if ( window.addEventListener ) { window.addEventListener("load", function(){sendPb(url);}, false);} else if ( window.attachEvent ) { window.atta...
分类:Windows程序   时间:2014-10-17 15:21:17    阅读次数:160
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!