码迷,mamicode.com
首页 >  
搜索关键字:if then else    ( 23991个结果
shell脚本练习003
1、#!/bin/bash myfile=/root/1316 cd$myfile forfilein`ls$myfile` do a=`ls$file|wc-l` if[$a==0] #a=`ls$filke` #if[-z$a] then echo"kong$file" else echo"feikong$file" mv/root/1316/$file/root/1316/kong/ fi done
分类:系统相关   时间:2015-05-05 16:48:01    阅读次数:122
case when then else end mysql
select(@rownum:=@rownum+1)ASserial_Num,tb_ser.nameasserver_Name,count(tb_uer.id)asregist_Num,count(casewhentb_uer.status=0thentb_uer.idelsenullend)asn...
分类:数据库   时间:2015-05-05 16:22:02    阅读次数:133
分治法实现一个数的n次方
算法导论上说分治法解决一个数的n次方,它的复杂度为logn;而用连乘的复度n;#includeusing namespace std;int recursion(int x,int n){ if(n==1){ return x; }else { if(n%2==0){//n为偶数 int r...
分类:其他好文   时间:2015-05-05 14:18:06    阅读次数:94
预处理消除NSLog
pch中:#ifndef __OPTIMIZE__#define NSLog(...) NSLog(__VA_ARGS__)#else#define NSLog(...) {}#endif__OPTIMIZE__ 这个宏是用来标识是否是release的。选择edit scheme菜单项编辑 ,选择i...
分类:其他好文   时间:2015-05-05 12:19:14    阅读次数:139
dede list 列表按文章权重排序
1,在list_artcile.htm模板中使用{dede:list pagesize='10′ orderby='weight' orderway='asc'}2,然后修改include目录下的arc.listview.class.php查找else if($orderby=="lastpost。...
分类:编程语言   时间:2015-05-05 12:14:21    阅读次数:159
MFC下判断文件是否存在
BOOL?IsFileExist(LPCTSTR?lpFileName) { ????if(NULL?==?lpFileName) ????{ ????????return?FALSE; ????} ????else ????{ ????????BOOL?bExist?=?TRUE; ?????...
分类:编程语言   时间:2015-05-05 10:49:28    阅读次数:159
求n个数的和
题目:     求1+2+3+4+....n(要求不能使用乘除法,for,while,if,else,switch ,case等关键字,以及条件判断语句(A?B:C). 解法一:       循环只是让相同的代码执行n遍而已,我们完全可以不用for和while达到这个效果,比如定义一个类,我们new一含有n个这种类型元素的数组,那么该类的构造函数将确定会被调用n次,我们可以将需要执行...
分类:其他好文   时间:2015-05-05 10:44:17    阅读次数:152
游标扩展
findruns10){ runs=k2) pred[i]=1) k<-c(k,1) else if (i <=-1){ k<-c(k,-1) }else{ k<-c(k,0) } } return(k)}
分类:其他好文   时间:2015-05-05 10:31:56    阅读次数:124
算法求和sum问题
问题:SUM(n) = 1 + 2 + 3 + ... + n写个算法回答:#includeint main(){ int n,sum; while(scanf("%d",&n)!=EOF) { if(n%2==0) //oushu sum=n/2*(n+1); else sum=(n+1)/2*n...
分类:编程语言   时间:2015-05-05 10:10:27    阅读次数:127
php将数据库导出成excel的方法
<?php $fname = $_FILES[‘MyFile‘][‘name‘]; $do = copy($_FILES[‘MyFile‘][‘tmp_name‘],$fname); if ($do) { echo"导入数据成功<br>"; } else { echo ""; } ?> <form ENCTYPE="multipart/form-data" ACTION=...
分类:数据库   时间:2015-05-05 01:26:20    阅读次数:272
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!