Eclipse
电脑
首先,在Eclipse中简历一个空的工程
在空的工程中建立一个类
然后开始编写程序
我的方法,如下图所示import java.math.BigInteger;public class Main { /** * @param args * @throws Exception */ public static void main(String[] args) throws Exception { // TODO Auto-generated method stub java.util.Scanner sc=new java.util.Scanner(System.in); int n = sc.nextInt(); BigInteger a=new BigInteger("1"); for (int l=0;l<=n;l++){ int m=sc.nextInt(); if(m<0){ throw new Exception(); } if(m==1){ System.out.println(1); } for (int j=1;j<=m;j++){ a=a.multiply(BigInteger.valueOf(j)); } System.out.println(a); }}}写的比较简单的程序,其中可能存在某些没有预料到的问题