1.基础知识 · 用于实现整除的操作符:// · 幂运算符:** · Python中变量没有类型。类型的强制转换使用函数int(32.9);而C中强制转换使用(int)32.9 · round():将浮点数四舍五入;floor():向下取整;ceil():向上取整 · 跨多行的字符串使用三个引号””...
分类:
编程语言 时间:
2014-07-19 09:32:25
阅读次数:
449
若要在i≤R≤j这个范围得到一个随机整数R,需要用到表达式 FLOOR(i+ RAND() * (j–i+ 1))。例如, 若要在7 到 12 的范围(包括7和12)内得到一个随机整数, 可使用以下语句:SELECT FLOOR(7 + (RAND() * 6));FLOOR(i+ RAND() *...
分类:
数据库 时间:
2014-07-17 23:18:18
阅读次数:
381
Math.round(x) 四舍五入 加上0.5向下取整 Math.round(1.5) 2 Math.round(-11.5) -11 Math.round(-11.2) -10Math.ceil(x) 不小于x的最小整数 Math.ceil(1.5) 2 Math.ceil...
分类:
其他好文 时间:
2014-07-16 17:40:53
阅读次数:
192
数字函数 abs(n):用于返回数字n的绝对值 ceil(n):返回大于等于数字n的最小整数 floor(n):返回小于等于数字n的最大整数 mod(m,n):返回m/n数字相除后的余数,如果n=0,则返回m round(n,[m]):执行四舍五入运算,如果省略m则四...
分类:
数据库 时间:
2014-07-14 14:14:00
阅读次数:
288
Problem Description
=== Op tech briefing, 2002/11/02 06:42 CST ===
"The item is locked in a Klein safe behind a painting in the second-floor library. Klein safes are extremely rare; most of them,...
分类:
其他好文 时间:
2014-07-12 19:19:42
阅读次数:
303
时间限制:0.25s空间限制:4M题意: 给出 n*m (1≤n、m≤9)的方格棋盘,用 1*2 的矩形的骨牌和 L 形的(2*2 的去掉一个角)骨牌不重叠地覆盖,求覆盖满的方案数。 Solution: 还是状态压缩,这次的情况比较多,要全部列出。 b1,b2分别代表上下两行...
分类:
其他好文 时间:
2014-07-10 15:23:08
阅读次数:
224
mysql> update test set create_time=concat('2013-10-01 ', floor(10+rand()*10),':',floor(10+rand()*49),':',floor(10+rand()*49)) where create_time='0000-00-00 00:00:00';
Query OK, 1 row affected
Rows ma...
分类:
数据库 时间:
2014-07-08 13:01:03
阅读次数:
227
链接求出三角形的外接圆,通过圆心和半径可以知道这个圆的上下左右最远点,分别判断这个四个点跟弧的两端点A,B的关系,假如判断P点,弧内给出点为C,判断PC是否与AB相交即可判断出P是否在弧上。精度问题 ceil-eps floor+eps 1 #include 2 #include 3 #in...
分类:
其他好文 时间:
2014-07-07 00:15:18
阅读次数:
252
1.丢弃小数部分,保留整数部分parseInt(5/2)2.向上取整,有小数就整数部分加1Math.ceil(5/2)3.四舍五入.Math.round(5/2)4.向下取整Math.floor(5/2)5.Math 对象的方法FF: Firefox, N: Netscape, IE: Intern...
分类:
Web程序 时间:
2014-07-02 21:32:45
阅读次数:
408
Pick-up sticks
Problem Description
Stan has n sticks of various length. He throws them one at a time on the floor in a random way. After finishing throwing, Stan tries to find the top sticks,...
分类:
其他好文 时间:
2014-07-02 15:29:53
阅读次数:
295