n的阶乘
import java.util.Scanner;
public class Test {
public static void main(String[] args) {//*n的输入*//
Scanner cin = new Scanner(System.in);
int n = cin.nextInt() ;
//*求阶乘的循环语句*//
int result = 1;
for (int i = 1; i <= n; i++) {
result *= i;
}
//*输出结果*//
System.out.println(result);
}
public class Test {
public static void main(String[] args) {//*n的输入*//
Scanner cin = new Scanner(System.in);
int n = cin.nextInt() ;
//*求阶乘的循环语句*//
int result = 1;
for (int i = 1; i <= n; i++) {
result *= i;
}
//*输出结果*//
System.out.println(result);
}
posted on 2018-04-01 22:16 😏😏dreaming 阅读(148) 评论(1) 收藏 举报
浙公网安备 33010602011771号