?? factorial.java
字號:
public class Factorial
{
public static void main(String[] args)
{
long limit = 20; // Calculate factorial of integers up to this value
long factorial = 1; // Calculate factorial in this variable
// Loop from 1 to the value of limit
for(int i = 1; i <= limit; i++)
{
factorial = 1; // Initialize factorial
int j =2;
while(j <= i)
factorial *= j++;
System.out.println(i + "!" + " is " + factorial);
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -