📄 jiecheng3.java
字号:
public class JieCheng3 { static long[] table = new long[21]; static { table[0] = 1; } static int last = 0; public static long factorial(int x) throws IllegalArgumentException { if (x >= table.length) throw new IllegalArgumentException("Overflow; x is too large."); if (x<0) throw new IllegalArgumentException("x must be non-negative."); while(last < x) { table[last + 1] = table[last] * (last + 1); last++; } return table[x]; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -