package test;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner; public class MyTest { public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
List<Integer> result = new ArrayList<Integer>();
int carry = 0;
int digit = 1;
int temp = 1;
int i,j;
result.add(1);
for(i = 2;i<=n;i++){
for(j = 0,carry = 0;j<digit;j++){
temp = result.get(j)*i+carry;
result.set(j, temp%10000);
carry = temp/10000;
} while(carry != 0){
result.add(digit++, carry%10000);
carry/=10000;
}
}
int count = 1;
System.out.print(result.get(digit-1));
for(i = digit-1;i>=1;i--){
count++;
if(result.get(i-1)<10){
System.out.print("000");
}else if(result.get(i-1)<100){
System.out.print("00");
}else if(result.get(i-1)<1000){
System.out.print("0");
}
System.out.print(result.get(i-1)); }
}
}

最新文章

  1. WindowsError的错误代码详解
  2. 快速上手RaphaelJS--Instant RaphaelJS Starter翻译(二)
  3. sikuli实战记录
  4. [转]HttpURLConnection的使用
  5. TCP经受时延的ACK
  6. linux mint 五笔安装方法
  7. C#编写自动关机程序复习的知识
  8. 27_Blog Reader
  9. [ArcGIS必打补丁]ArcGIS 10.1 SP1 for (Desktop, Engine, Server) Quality Improvement Patch
  10. MySql 学习之路-聚合函数
  11. html css hover也会冒泡
  12. python之路---模块
  13. windwos安装RabbitMQ
  14. webService上传图片
  15. War Chess (hdu 3345)
  16. C#快速删除bin和obj文件夹的方法
  17. hdu 5826 physics 物理题
  18. Android 开发自己的网络收音机2——电台列表(SlidingMenu侧滑栏)
  19. php array_rand()函数从数组中随机选择一个或多个元素
  20. tensorflow模型持久化保存和加载

热门文章

  1. Java实现九宫格
  2. Leetcode0005--Longest Palindromic Substring 最长回文串
  3. hibernate_08_关联映射_一对多
  4. python3 str类型
  5. Cell期刊论文:为什么计算机人脸识别注定超越人类?(祖母论与还原论之争)
  6. SLAM: Ubuntu14.04_Kylin安装ROS-Indigo
  7. vue路由中的 Meta
  8. PAT_A1116#Come on! Let&#39;s C
  9. 【剑指Offer】29、最小的K个数
  10. let、var、const用法区别