class Vecter3: def_init_(self,x=0,y=0,z=0): self.X=x self.Y=y self.Z=z def_add_(self,n): r=Vecter3() r.X=self.X+n.X r.Y=self.Y+n.Y r.Z=self.Z+n.Z retu ...
分类:
其他好文 时间:
2020-04-21 09:33:02
阅读次数:
947
function shuffle(arr){ var newArr = []; while (arr.length){ var randomIndex = Math.floor(Math.random() * arr.length); newArr.push(arr.splice(randomInd ...
分类:
编程语言 时间:
2020-04-17 15:23:54
阅读次数:
74
小程序开发一、WXML四大特性1.数据绑定 列表项目 2.列表渲染 列表项目 3.条件渲染 wxml中:wx:if wx:elif wx:else js中:condition:Math.floor(Math.random()*3+1)1~3的随机数 Math.random()生成一个0~1的浮点数M ...
分类:
微信 时间:
2020-04-16 19:20:03
阅读次数:
81
/*随机获取颜色*/function getRandomColor() { var r = Math.floor(Math.random() * 256); var g = Math.floor(Math.random() * 256); var b = Math.floor(Math.random ...
分类:
Web程序 时间:
2020-04-13 12:27:50
阅读次数:
141
题意: 给一个浮点数序列$a$,其和为$0$。求一个序列$b$,满足$b[i]=ceil(a[i])$或者$b[i]=floor(a[i])$。 思路: 全部数字向下取整,赋值给$b$,统计$b$的和,若和不为$0$,则使原本不为整数的$a[i]$对应的$b[i]+1$,直到和为$0$。 代码: 1 ...
分类:
其他好文 时间:
2020-04-12 18:40:06
阅读次数:
77
On another floor of the A.R.C. Markland-N, the young man Simon "Xenon" Jackson, takes a break after finishing his project early (as always). Having a ...
分类:
其他好文 时间:
2020-04-11 18:34:23
阅读次数:
56
1.int() 向下取整 内置函数 2.round(x,n) 四舍五入 内置函数 n表示保留的小位数,默认取整 保留2位小数 3.floor() 向下取整 math模块函数 4.ceil() 向上取整 math模块函数 5.modf() math模块函数 分离整数和小数位,并分别返回 最后一个输出, ...
分类:
编程语言 时间:
2020-04-07 11:12:17
阅读次数:
111
Math.abs、Math.ceil、Math.floor、Math.max、Math.min、Math.sqrt、Math.pow、Math.round、Math.random ...
分类:
Web程序 时间:
2020-04-06 12:04:29
阅读次数:
102
求$\sum{\left \lfloor \frac{n}{i} \right \rfloor}$ 慢且麻烦的一般方法: 设 $s=\left \lfloor \sqrt{n} \right \rfloor$ 对于ss的分块算 常数很大 考虑$\sum{\left \lfloor \frac{n}{ ...
分类:
其他好文 时间:
2020-04-05 22:32:21
阅读次数:
116
['abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ','1234567890','~!@#$%^&*()_+";",./?<>']; var rand = function(min, max){ return Math.floor(Ma ...
分类:
Web程序 时间:
2020-04-05 20:23:10
阅读次数:
68