Java
while语句算阶乘
package JavaTest;
import java.util.Scanner;
public class Test {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int x = scan.nextInt();
int i = 1;
while (x!=0) {
i=i*x;
x=x-1;
}
System.out.print(i);
}
}