摘要:向下滚动页面,首页有个方框图片显示上方内容,给人感觉是一个长图作为背景,中间是个透明方框,创意不错
阅读全文
摘要:10元红包,分给5个人: 最小单位是0.01元 随机 将10元分成10×100分(最小的单位)共1000份 然后分配5个盒子(5人分) 每一份都随机往5个盒子里添加(共1000份) 此方法证明Math.random在多次以后区域平均,不适合多次分配
阅读全文
摘要:题目描述 输入一个字符串,求出该字符串包含的字符集合 输入描述: 每组数据输入一个字符串,字符串最大长度为100,且只包含字母,不可能为空串,区分大小写。 输出描述: 每组数据一行,按字符串原有的字符顺序,输出字符集合,即重复出现并靠后的字母不输出。 输入例子: abcqweracb 输出例子: a
阅读全文
摘要:题目描述 小东和三个朋友一起在楼上抛小球,他们站在楼房的不同层,假设小东站的楼层距离地面N米,球从他手里自由落下,每次落地后反跳回上次下落高度的一半,并以此类推知道全部落到地面不跳,求4个小球一共经过了多少米?(数字都为整数)给定四个整数A,B,C,D,请返回所求结果。 测试样例: 100,90,8
阅读全文
摘要:function CArray(numElements) { this.dataStore = []; this.pos = 0; this.numElements = numElements; this.insert = insert; this.toString = toString; this.clear = clear; this.setData = setData; t...
阅读全文
摘要:function Node(data, left, right) { this.data = data; this.left = left; this.right = right; this.show = show; } function show() { return this.data; } function BST() { this.root = null; this.i...
阅读全文
摘要:function Set() { this.dataStore = []; this.add = add; this.remove = remove; this.size = size; this.union = union; this.intersect = intersect; this.subset = subset; this.difference = differenc...
阅读全文
摘要:function Stack() { this.dataStore = []; this.top = 0; this.push = push; this.pop = pop; this.clear = clear; this.peek = peek; this.length = length; } function push(element) { this.dataStore[...
阅读全文
摘要:var fs=require('fs'); function Queue() { this.dataStore = []; this.enqueue = enqueue; this.dequeue = dequeue; this.front = front; this.back = back; this.toString = toString; this.empty = empt...
阅读全文
摘要:function HashTable() { this.table = new Array(137); this.simpleHash = simpleHash; this.showDistro = showDistro; this.put = put; //this.get = get; } function put(data) { var pos = this.simpleHa...
阅读全文
摘要:function Dictionary(){ this.datastore={}; this.add=add; this.find=find; this.remove=remove; this.showAll=showAll; } function add(key,value){ this.datastore[key]=value; } function find(key){ ...
阅读全文
摘要:function List() { this.listSize = 0; this.pos = 0; this.dataStore = []; // 初始化一个空数组来保存列表元素 this.clear = clear; this.find = find; this.toString = toStri...
阅读全文
摘要:function Checking(amount){ if(amount){ this.banlance=amount; }else{ this.banlance=0; }; this.deposit=function(dep){ this.banlance+=dep; }; this.withdraw=func...
阅读全文
摘要:1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 ...
阅读全文
摘要:ES6 5S跳过 container message... container message... container message... container message... container message... container m...
阅读全文