南阳理工 28题

http://acm.nyist.net/JudgeOnline/problem.php?pid=28

连乘

 1 import java.io.*;
 2 import java.math.BigInteger;
 3 import java.util.*;
 4 
 5 
 6 public class Main {
 7     public static void main(String[] args) {
 8     Scanner cin=new Scanner(System.in);
 9     int n= cin.nextInt();
10     BigInteger ans=BigInteger.ONE;
11     for(int i=1;i<=n;i++)
12         ans=ans.multiply(BigInteger.valueOf(i));
13     System.out.println(ans);
14      }
15 }
View Code

 

posted @ 2016-03-11 22:43  yyblues  阅读(204)  评论(0编辑  收藏  举报