码迷,mamicode.com
首页 >  
搜索关键字:length    ( 19575个结果
Js 常用小代码
//判断一个汉子等于两个字符function getByteLen(val) { var len = 0; for (var i = 0; i < val.length; i++) { var a = val.charAt(i); if (a.match(/[...
分类:Web程序   时间:2014-05-26 20:47:25    阅读次数:205
java获取随机数(版本2)自定义随机数
import java.util.Random;/** * * @author mengzw * @since 3.0 2014-5-22 */public class RandomTest { /** * 生成随机字符串 * * @param length...
分类:编程语言   时间:2014-05-26 16:10:50    阅读次数:379
冒泡排序
1 int[] arr = {1,4,2,5,7,3}; 2 int temp = 0; 3 //升序 4 for (int i = arr.length-1; i > 0; --i) { 5 for (int j = 0; j i; j--) {17 if(arr[...
分类:其他好文   时间:2014-05-26 15:37:21    阅读次数:266
poj 3253 -- Fence Repair
Fence RepairTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 24252Accepted: 7766DescriptionFarmer John wants to repair a small length of the f...
分类:其他好文   时间:2014-05-26 15:12:15    阅读次数:193
对json数据传进行排序
今天有个需求,要做个排行榜。后台Json传过来,坑爹的是要在前台排序。心想,排序还不简单,什么折半冒泡之类的。代码如下:var userList = json....//外层循环,共要进行arr.length次求最大值操作 for(var i=0;i<arr.length;i++){ ...
分类:Web程序   时间:2014-05-26 14:53:38    阅读次数:250
JS类似Java String.format的函数
String.prototype.format = String.prototype.f = function () { var s = this, i = arguments.length; while (i--) { s = s.replace(new R...
分类:编程语言   时间:2014-05-26 10:49:23    阅读次数:356
javascript常用对象
数组属性length计算长度方法join()将数组元素组合成reverse()反转数组sort()进行排序内置函数eval(string)eval函数直接计算出string的值isNaN(变量)检验参数是否是一个数字,如果不是数字返回trueString对象属性length返回字符串的长度方法big...
分类:编程语言   时间:2014-05-26 08:15:15    阅读次数:241
2014辽宁ACM省赛 Distance
问题 E: Distance 时间限制: 1 Sec  内存限制: 128 MB 提交: 48  解决: 12 [提交][状态][论坛] 题目描述 There is a battle field. It is a square with the side length 100 miles, and unfortunately we have two comrades who get ...
分类:其他好文   时间:2014-05-26 05:57:27    阅读次数:325
leetcode -day21 Longest Substring Without Repeating Characters
?? 1、Longest Substring Without Repeating Characters Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letter...
分类:其他好文   时间:2014-05-26 05:03:19    阅读次数:172
LeetCode: Jump Game [054]
【题目】 Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that position. Determine if you are able to reach the last index. For example:...
分类:其他好文   时间:2014-05-24 20:44:39    阅读次数:221
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!