n >= 6 的时候减3, 最后分类讨论, 上个Java

 import java.math.BigInteger;
import java.util.*; public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
BigInteger ans = BigInteger.valueOf();
while(n >= ) {
ans = ans.multiply(BigInteger.valueOf());
n -= ;
} if(n == ) {
ans = ans.multiply(BigInteger.valueOf());
} else if(n == ) {
ans = ans.multiply(BigInteger.valueOf());
} else if(n == ) {
ans = ans.multiply(BigInteger.valueOf());
} else if(n == ) {
ans = ans.multiply(BigInteger.valueOf());
} String s = ans.toString();
System.out.println(s.length());
for(int i = ; i < s.length() && i < ; i++) {
System.out.print(s.charAt(i));
}
}
}