码迷,mamicode.com
首页 >  
搜索关键字:else    ( 23991个结果
两个算法,
-(void)lifeViewAnimation{ static int a = 0; static BOOL isAdd = NO; if (a >= 310) { a = a - 3; isAdd = NO; }else if(a == 0){ a = a + 3; ...
分类:编程语言   时间:2015-01-12 17:11:04    阅读次数:189
判断某一文件夹是否存在,不存在则创建该文件夹
1.判断是否存在一:if(@mkdir("/img",0700)){echo"ok";}else{echo"error";}//存在输出“ok”,不存在输出“error”二:if(is_dir("/img")){echo"ok";}else{echo"error";}//存在输出“ok”,不存在输出“error”if(is_dir("img")){echo"ok";}else{echo"error";}//存在输出“ok”..
分类:其他好文   时间:2015-01-12 16:49:59    阅读次数:182
回溯算法(解任意阶数独)
回溯算法的基本框架为     函数名(int cnt){        for()        { 赋值;       if(==){              }else{                   函数名(cnt+1);              } 抹去;         }}/* theme:求解数独 回溯算法 Cod...
分类:编程语言   时间:2015-01-12 09:27:10    阅读次数:257
cocos3——5.js获取文件夹下文件列表
1.C++: #include #include #include #include #include "cocos2d.h" #if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 #include #include #else #include #endif namespace fs { int readDir( const ch...
分类:Web程序   时间:2015-01-11 16:14:53    阅读次数:202
华为机试—01背包(等于总值)
给定一个总值,和一个整数数组,从数组中找出和等于总值的那几个数, 如果存在,数相应的下标为1,其余的为0,如果不存在,输出no。 #include #include int a[50]; int f[50]={0}; int find(int n,int m) { if(n==0) return 1;//刚好递归结束 else if(n0&&m==0) return...
分类:其他好文   时间:2015-01-11 14:56:20    阅读次数:235
将一篇文本中的单词保存在一个字符串数组中
charstring[]="IloveiosIwanttomakeanprojectzpplanou";char*strs[255]={0};inti=0,count=0;intwordcount=0;while(*(string+i)!=‘\0‘){chartemp[100]={0};intk=0;staticintm=0;if(*(string+i)!=‘‘){count++;}else{char*str=malloc(count+1);wordcount++;for(intj=i-count;j<..
分类:编程语言   时间:2015-01-11 06:20:52    阅读次数:154
进制转换
#include#define M 2unsigned process(unsigned n){ static unsigned S=1; unsigned d,e; d=n/M; if(d==0) e=1; else { S*=M; e=M*process(d); } if (e==1) p...
分类:其他好文   时间:2015-01-10 18:10:16    阅读次数:221
n阶多项式递归
#include float p(int n,float x){ if(n==0) return (1); else if(n==1) return (x); else return (((2*n-1)*x-p((n-1),x)-(n-1)*p((n-2),x))...
分类:其他好文   时间:2015-01-09 20:42:03    阅读次数:165
来,试试PERL
试试,看看能否真的替代AWK,SED这些的。。。#!/usr/bin/perlprint "hello, world!\n";$line = ;if ($line eq "\n") { print "That was just a blank line!\n";}else { print...
分类:其他好文   时间:2015-01-09 19:18:35    阅读次数:278
jQuery下通过$.browser来判断浏览器
使用方法:$.browser.['浏览器关键字']代码如下:$(function() {if($.browser.msie) {alert("this is msie");}else if($.browser.safari){alert("this is safari!");}else if($.b...
分类:Web程序   时间:2015-01-09 17:10:13    阅读次数:119
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!