## codewars066 - Large Factorial 原

圣洁之子

### Instructions

``````https://www.codewars.com/kata/557f6437bf8dcdd135000010/train/java
``````

### Solution:

``````import java.math.BigInteger;

public class Kata
{

public static String Factorial(int n) {
if(n < 0){
return null;
}
if(n == 0 || n == 1){
return "1";
}
BigInteger product = BigInteger.ONE;
for(int i = 2; i <= n; i++){
product = product.multiply(new BigInteger(String.valueOf(i)));
}
return product.toString();
}

}
``````

### Sample Test:

``````https://www.codewars.com/kata/557f6437bf8dcdd135000010/train/java
``````

### 圣洁之子

hdu1018（求n！的位数）

Problem Description In many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In......

whatiwhere
2017/12/13
0
0
JavaScript中的递归

Fundebug
2017/06/20
14
0
C++阶乘和数,这程序错在哪里了???

#include using namespace std; void total_factorial(int n); //求阶乘和数 int factorial(int n); //求一个数的阶乘 int main() { int m; cin>>m; total_factoreal(m); } void total_facto......

2014/03/15
378
8

03/30
9
0
f(x)=xf(x-1)求f(x)的表达式

#coding=utf-8 def factorial(x): if x == 0: return 1 else: return x * factorial(x - 1) print factorial(6) factorial(6)计算结果是720 看上去这个函数就是f(x)=x*f(x-1)，那么f(x)的表达......

aaronong
2012/11/28
769
15

web前端开发高级

32分钟前
5
0
PostgreSQL 11.3 locking

rudi

5
0
Mybatis Plus sql注入器

21
1

4
0

9
0