
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); |
} |
} |




初级程序员
by: 雨落冬夜 发表于:2017-04-19 12:04:58 顶(0) | 踩(0) 回复
都是简单代码呀
回复评论