码迷,mamicode.com
首页 >  
搜索关键字:return    ( 60766个结果
js一些经典知识总结
function factorial(num){ if(num<=1){ return 1; }else{ return num * arguments.callee(num-1); //指向一个正在执行函数的指针,可以实现对函数的递归...
分类:Web程序   时间:2014-06-11 08:56:56    阅读次数:244
一个字符串排列的小算法
给定n个A和2n个B,用这些字符拼成一个字符串,要求这个串的所有前缀和后缀B的个数始终不少于A。 (一个字符串的前缀是只从开头到某个位置为止的子串,后缀是只从某个位置到结尾的子串)。 输入格式 多组数据,每组数据只有一行,包含一个正整数n。(n<=10^17)。 输出格式 每组数据输出一行,最终结果...
分类:其他好文   时间:2014-06-11 07:49:31    阅读次数:239
A Swift Tour(3) - Functions and Closures
Functions and Closures使用func来声明函数,通过括号参数列表的方式来调用函数,用 --> 来分割函数的返回类型,参数名和类型,例如:func greet(name: String, day: String) -> String { return "Hello \...
分类:其他好文   时间:2014-06-11 07:48:02    阅读次数:254
LeetCode ImplementStrstr
class Solution {public: char *strStr(char *haystack, char *needle) { if (haystack == NULL || needle == NULL) return NULL; int wpos[25...
分类:其他好文   时间:2014-06-11 07:40:05    阅读次数:200
约瑟夫问题
/**给定正整数k( 2 int joseph(int k){ 3 int m,t,a=1,b,i,n; 4 while(1){ 5 for(b=1;bk)14 return m;15 }16 a+=2;...
分类:其他好文   时间:2014-06-10 00:17:35    阅读次数:261
leetcode--Combinations
Given two integersnandk, return all possible combinations ofknumbers out of 1 ...n.For example,Ifn= 4 andk= 2, a solution is:[ [2,4], [3,4], [2,3],...
分类:其他好文   时间:2014-06-08 08:08:29    阅读次数:294
js SetTimeout传参问题
今天写代码遇到这样一个问题,先上代码 1 2 function textout(obj){ 3 if(opac==60){opac=0;return;}; 4 opac+=10; 5 if(document.all){ 6 obj.style.filter=...
分类:Web程序   时间:2014-06-08 06:23:46    阅读次数:277
java中文字符串截取
/*** author geksong * function 中文字符串相关操作**/public class ChinaStringUtil {/** * 判断字符是不是中文字符 * @param c * @return */public static boolean isChinese(char...
分类:编程语言   时间:2014-06-08 00:16:40    阅读次数:385
改进的模板替换
之前美丽湾项目是用赢家写的替换方法,替换数据时,无法深度遍历,这里修改一下方法: 1 function tempExt(h, data) { 2 return h.replace(/\{(.*?)\}/g, function (str, m) { 3 ...
分类:其他好文   时间:2014-06-07 23:05:37    阅读次数:231
leetcode--Remove Nth Node From End of List
Given a linked list, remove thenthnode from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After re...
分类:其他好文   时间:2014-06-07 16:54:26    阅读次数:221
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!