import java.util.Scanner;
class JieCheng
{
public static void main(String[] args)
{
Scanner scanner = new Scanner(System.in);
System.out.println("请输入一个数据");
int number = scanner.nextInt();
long sum=1;
for (int x = number ; x >= 1 ; x-- )
{
sum *= x;
}
System.out.println(number+"的阶乘是"+sum);
}
}
|