解题思路:
思路一:先求M的N次方,然后M^N%1000求最后三位数,但是M的N次方很有可能会溢出,导致输出结果异常或错误。
思路二:思路一不行的话,我们得找到他对应的等效方法,M每乘M就对1000求余,其最后三位数是等效的。...
分类:
其他好文 时间:
2015-07-09 11:26:49
阅读次数:
114
题目背景
判断字符串是否是有效数字,是则返回0,不是则返回-1
接口
int NumType(String s)
举例
例如:输入的字符串是123.456,返回0
输入123a,返回-1
输入123.456d,返回0
解题思路:直接使用double类型的静态方法...
分类:
其他好文 时间:
2015-07-09 11:23:36
阅读次数:
82
随手写的,项目中没用,不一定对,只作参考。--游戏时间相关函数local gt = {}local math = mathlocal ONE_MINUTE = 60local ONE_HOUR = ONE_MINUTE * ONE_MINUTElocal ONE_DAY = ONE_HOUR *.....
分类:
其他好文 时间:
2015-07-09 11:09:23
阅读次数:
216
这道题纯考数学,懒得打字解释了 方法如下from math import factorial class Solution: # @param {integer} n # @param {integer} k # @return {string} def getPermuta...
分类:
其他好文 时间:
2015-07-09 06:16:58
阅读次数:
113
1、演示多列转为单行
数据文件及内容: student.txt
xiaoming|english|92.0
xiaoming|chinese|98.0
xiaoming|math|89.5
huahua|chinese|80.0
huahua|math|89.5
创建表studnet:
create table student(name string,subject strin...
分类:
其他好文 时间:
2015-07-09 00:54:01
阅读次数:
166
String类string a = "abcdef123456"; 注:字符串的长度是从0开始计数的如:0,1,2,3,4,5,6,7,8,9........a.Length; 是一个属性,代表字符串的长度 ★a[2]; a代表字符串中a打头,2代表在字符串中的位置,从0开始数,[]是索引号...
分类:
其他好文 时间:
2015-07-09 00:41:58
阅读次数:
91
#include "stdio.h" #include "stdlib.h" #include "math.h" #include "time.h" #define OK 1 #define ERROR 0 #define TRUE 1 #define FALSE 0 #define MAXSIZE...
分类:
其他好文 时间:
2015-07-09 00:37:57
阅读次数:
109
#define _CRT_SECURE_NO_WARNINGS#include "string.h"#include "stdio.h" #include "stdlib.h" #include "io.h" #include "math.h" #include "time.h"#define OK...
分类:
其他好文 时间:
2015-07-09 00:31:55
阅读次数:
115
#include "string.h"#include "stdio.h" #include "stdlib.h" #include "io.h" #include "math.h" #include "time.h"#define OK 1#define ERROR 0#define TRUE 1...
分类:
其他好文 时间:
2015-07-09 00:19:50
阅读次数:
230
PHP ECMAScript 向上取整 ceil($number) Math.ceil( number ) 向下取整 floor($number) Math.floor( number ) 绝对值 abs($number) Math.abs( number ) 四舍五入 round($number,...
分类:
Web程序 时间:
2015-07-08 18:45:47
阅读次数:
152