Math 对象属性属性描述E返回算术常量 e,即自然对数的底数(约等于2.718)。LN2返回 2 的自然对数(约等于0.693)。LN10返回 10 的自然对数(约等于2.302)。LOG2E返回以 2 为底的 e 的对数(约等于 1.414)。LOG10E返回以 10 为底的 e 的对数(约等于...
分类:
Web程序 时间:
2015-08-31 14:52:51
阅读次数:
243
方法一:var getRandomColor = function(){ return '#' + (function(color){ return (color += '0123456789abcdef'[Math.floor(Math.random()*16)]) &...
分类:
Web程序 时间:
2015-08-31 11:28:29
阅读次数:
146
1 import math2 print math.sin (0.5)3 print math.cos (0.5)关键点:1、sin、cos等数学符号后面要加括号(),括号内的参数为弧度制表示法(我也忘了什么是弧度制了。。。)2、调用sin、cos的时候,要用math.sin(),math.co.....
分类:
编程语言 时间:
2015-08-31 01:06:32
阅读次数:
178
题目地址:51Nod 1256
题意:给出2个数M和N(M < N),且M与N互质,找出一个数K满足0 < K < N且K * M % N = 1,如果有多个满足条件的,输出最小的。
思路:K*M%N=1可以写成K*M-Y*N=1,这样公式就变成了扩展欧几里德求K值。因为是要求最小的,所以求出特解K以后,要变成(K%N+N)%N。#include
#include <math...
分类:
其他好文 时间:
2015-08-30 19:39:25
阅读次数:
122
import java.io.BufferedInputStream;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;
class Node{
int x,y;
int f;
Node(){};
}
class Mycmp...
分类:
编程语言 时间:
2015-08-30 15:51:12
阅读次数:
148
可以通过输入身份证的前17位,然后算出18位,与输入的第18位进行校验,判断输入的是否是合法的身份证“package com.edaixi.testjava;import java.math.MathContext;import java.util.regex.Matcher;import java...
分类:
编程语言 时间:
2015-08-30 11:06:31
阅读次数:
126
【题目链接】:click here~~
【题目大意】:
If x
If x >= 10 f(x) = a0 * f(x-1) + a1 * f(x-2) + a2 * f(x-3) + …… + a9 * f(x-10);
问f(k)%m的值。
【思路】:矩阵快速幂,具体思路看代码吧,注意一些细节。
代码:
#include
using namespace std;
typede...
分类:
其他好文 时间:
2015-08-29 23:24:49
阅读次数:
273
Problem DescriptionAs we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to practice. There is o...
分类:
其他好文 时间:
2015-08-29 23:16:15
阅读次数:
245
Problem DescriptionAs we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to practice. There is o...
分类:
其他好文 时间:
2015-08-29 23:12:18
阅读次数:
260
package himi.hebao04;import java.math.BigDecimal;public class TestDemo07 { public static void main(String[] args) { // TODO 自动生成的方法存根 ...
分类:
编程语言 时间:
2015-08-29 23:02:31
阅读次数:
248