码迷,mamicode.com
首页 >  
搜索关键字:number    ( 26994个结果
javascript数字类型
JS的数字类型js的数字类型只有一种,叫做Number.js中的所有数字皆属于此类型。包括整数1,-2,3,浮点数1.1,-1.2,1.3都属于此类型。所以,在js中,typof 整数或者 typof 浮点数返回的都是number.JS的类型转换js中有三个常用函数用于将非数字类型转换为数字类型,分别是,Number(),parseInt,parseFloat();可以直接在window作用域下调用...
分类:编程语言   时间:2015-07-10 16:46:36    阅读次数:118
shell脚本实现冒泡排序
手动输入一行字符串,并对其排序。 脚本如下:#!/bin/bash #a test about sort echo "please input a number list" read -a arrs for((i=0;i<${#arrs[@]};i++)){ for((j=0;j<${#arrs[@]}-1;j++)){ if [[ ${arrs[j]} -gt ${arrs[j+...
分类:编程语言   时间:2015-07-10 15:15:42    阅读次数:123
1041. Be Unique (20)
题目如下: Being unique is so important to people on Mars that even their lottery is designed in a unique way. The rule of winning is simple: one bets on a number chosen from [1, 104]. The first one...
分类:其他好文   时间:2015-07-10 15:14:42    阅读次数:127
Leetcode & CTCI ---Day 1
Maximum Depth of Binary Tree (DFS, TREE)Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path fr...
分类:其他好文   时间:2015-07-10 13:17:22    阅读次数:99
[LeetCode][Java] Letter Combinations of a Phone Number
题目: Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telephone buttons) is given below. Input...
分类:编程语言   时间:2015-07-10 09:41:01    阅读次数:181
从1到n整数中1出现的次数
解法一: int NumberOf1Between1AndN(unsigned int n) { int number = 0; for (unsigned int i = 1; i number += NumberOf1(i); return number; } int NumberOf1(unsigned int n) { int number = 0; w...
分类:其他好文   时间:2015-07-10 09:40:15    阅读次数:177
leetCode 40.Combination Sum II(组合总和II) 解题思路和方法
Combination Sum II Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. Each number in C may only be used...
分类:其他好文   时间:2015-07-10 09:30:20    阅读次数:237
leetCode 39.Combination Sum(组合总和) 解题思路和方法
Combination Sum Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same repeated number may be chosen from...
分类:其他好文   时间:2015-07-10 09:29:59    阅读次数:424
1.Two Sum (Array; Divide-and-Conquer)
Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two nu...
分类:其他好文   时间:2015-07-10 00:14:30    阅读次数:116
JS中的数据类型(见《Jquery实战<附录>》)
一、所有数据类型的常量都看作对象。(一)、JS自带的数据类型怎样创建对象?number、String这些基本类型的值,23、"abc"等常量本身就是对象。Date类型:通过一个构造函数创建对象,new Date(2015,7,8)(二)、用户怎样创建自定义的对象?1.通过var o = new Ob...
分类:Web程序   时间:2015-07-10 00:13:02    阅读次数:185
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!