JAVA/자바

자바 팩토리얼

왕왕왕왕 2015. 9. 10. 09:28


public class factorial{

public static void main(String args[]) {

BigInteger a = BigInteger.ONE;

for (int i = 1; i < 21; i++) { // 10번 반복

a=a.multiply(BigInteger.valueOf(i));

System.out.print(" " + a);

}

}