package one; import java.util.Scanner; public class diyige { public static void main (String[] args) { Scanner input=new Scanner(System.in); System.out.println("请输入一个数"); int shuzi=input.nextInt(); double zongshu=1; int i=1; while(i<=shuzi){ zongshu=zongshu*i; i++; } System.out.println("总数:"+zongshu); } }