-(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
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
给定一个总值,和一个整数数组,从数组中找出和等于总值的那几个数,
如果存在,数相应的下标为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
#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
试试,看看能否真的替代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
使用方法:$.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