import java.util.Scanner; |
public class Test1 { |
public static void main(String[] args) { |
Scanner input= new Scanner(System.in); //外部输入 |
System.out.println( "请输入要求的阶乘数:" ); |
int j=input.nextInt(); //接受输入的值,并赋给j |
int result= 1 ; |
/*阶乘的求法 |
*/ |
for ( int i= 1 ;i<=j;i++){ |
result =i*result; |
}System.out.print(result); |
} |
} |