Input : 150
output : 0
package zh.codegym.task.task15.task1531;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
/*
阶乘
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int input = Integer.parseInt(reader.readLine());
reader.close();
System.out.println(factorial(input));
}
public static String factorial(int n) {
//在此编写你的代码
if(n == 1) return "1";
else if(n == 0) return "0";
long result = 1L;
for(long i=1;i<n;i++){
result = result * (i + 1);
}
return Long.toString(result);
}
}