- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
import java.math.BigInteger;
import java.util.Scanner;
import static java.lang.Integer.*;
import static java.lang.String.*;
import static java.lang.System.*;
public class Main
{
public static void main(String[] args) throws Exception
{
if (!(args.length == 0 ? true : args[0] != "t")) out.println();
else
{
args = !(args.length != 0) ? new String[2] : args;
try (Scanner sc = new Scanner(in))
{
args[0] = null != args[0] ? args[0] : valueOf(new BigInteger(sc.nextLine()));
args[1] = null != args[1] ? args[1] : valueOf(sc.nextLine()).toString();
}
char[] start;
start = new char[]{ 'F', '(' };
char[] equals;
equals = new char[]{ ')', ' ', '=', ' ' };
char[] end;
end = ";".toCharArray();
out.println(new StringBuilder().append(start).append(valueOf(valueOf(args[0]))).append(equals)
.append(F(new BigInteger(args[0] = valueOf(BigInteger.ONE.add(new BigInteger(args[0])))).subtract(new BigInteger("1"))))
.append(end)
.toString());
args[0] = valueOf(args[0]) > valueOf(args[1]) ? "t" : args[0];
main(args);
}
}
protected static BigInteger F(BigInteger number)
{
return !BigInteger.ZERO.equals(BigInteger.ZERO.max(number)) ?
F(number.subtract(BigInteger.ONE)).multiply(number) :
BigInteger.ONE;
}
}
Факториал while(true).... #BigInteger #Java
Это жесть, товарищи.