N!

Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)

Total Submission(s): 64256    Accepted Submission(s): 18286

Problem Description
Given an integer N(0 ≤ N ≤ 10000), your task is to calculate N!
 
Input
One N in one line, process to the end of file.
 
Output
For each N, output N! in one line.
 
Sample Input
1
2
3
 
Sample Output
1
2
6
 
Author
JGShining(极光炫影)
 
Recommend
We have carefully selected several similar problems for you:  1715 1047 

pid=1063" target="_blank" style="color:rgb(26,92,200); text-decoration:none">1063 1753 1316 



Java大法好。退C保平安.......开玩笑的,Java和C各有各的优劣势,缺一不可!

我不会大数模版。就用BigInteger了,HDU大数水题不解释!


import java.io.*;
import java.math.BigInteger;
import java.util.*; public class Main
{ public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
while(input.hasNext())
{
int n = input.nextInt();
BigInteger p = BigInteger.ONE;
for(int i=1;i<=n;i++)
{
p=p.multiply(BigInteger.valueOf(i));
}
System.out.println(p);
}
} }


 

HDU-1042-N!(Java大法好 &amp;&amp; HDU大数水题)的更多相关文章

  1. HDU 4788 Hard Disk Drive (2013成都H,水题)

    Hard Disk Drive Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)T ...

  2. hdu 1042 N! java大数及判断文件末尾

    N! Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submi ...

  3. hdu 2108:Shape of HDU(计算几何,判断多边形是否是凸多边形,水题)

    Shape of HDU Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Tota ...

  4. hdu 4540 威威猫系列故事——打地鼠 dp小水题

    威威猫系列故事——打地鼠 Time Limit: 300/100 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others) Total ...

  5. HDU-1047-Integer Inquiry(Java大数水题 &amp;&amp; 格式恶心)

    Integer Inquiry Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) ...

  6. HDU 5776 sum (BestCoder Round #85 A) 简单前缀判断+水题

    分析:就是判断简单的前缀有没有相同,注意下自身是m的倍数,以及vis[0]=true; #include <cstdio> #include <cstdlib> #includ ...

  7. HDU 4788 Hard Disk Drive (2013成都H,水题) 进位换算

    #include <stdio.h> #include <algorithm> #include <string.h> #include<cmath> ...

  8. HDU 6077 17多校4 Time To Get Up 水题

    Problem Description Little Q's clock is alarming! It's time to get up now! However, after reading th ...

  9. HDU 3215 The first place of 2^n (数论-水题)

    The first place of 2^n Problem Description LMY and YY are mathematics and number theory lovers. They ...

随机推荐

  1. ijkplayer详解AAA

    https://www.jianshu.com/p/c5d972ab0309 https://www.android-arsenal.com/details/1/530 https://stackov ...

  2. Razor Intro

    http://www.w3schools.com/aspnet/razor_intro.asp Razor is not a programming language. It's a server s ...

  3. findContours 轮廓查找

    物体的轮廓勾勒出了物体的整体形状,物体形状的边界像素一起组合成了轮廓. 灰度图像边界的明显特征是边界两侧灰度级的突变,根据这个特征,使用Sobel.拉普拉斯或Canny之类的边缘检测算子可以有效的检测 ...

  4. [ZJOI 2010] 数字计数

    [题目链接] https://www.lydsy.com/JudgeOnline/problem.php?id=1833 [算法] 数位DP [代码] #include <algorithm&g ...

  5. [转载]linux上安装oracle

    原文地址:linux上安装oracle作者:天涯恨客 1.创建oinstall组 [root@xieqing ~]# groupadd oinstall 创建dba组 [root@xieqing ~] ...

  6. LinkedHashMap做缓存

    项目上需要写一个缓存,这样就不需要频繁地访问数据库,我使用的是 //缓存 private final Map<String, JSONArray> schemaCache = new Li ...

  7. Mysql库的操作

    一.系统数据库 执行如下命令,查看系统库 show databases; information_schema: 虚拟库,不占用磁盘空间,存储的是数据库启动后的一些参数,如用户表信息.列信息.权限信息 ...

  8. Boolean占几个字节

    Boolean:1.1bit 2.1byte 3.4byte 简书地址:  http://www.jianshu.com/p/2f663dc820d0 官网地址:       http://docs. ...

  9. JS 判断数组包含某个字符

    //arrDisable 数组  infoType 字符 if($.inArray(infoType, arrDisable)) { console.log('包含'); }

  10. lua类实现

    _Account = {} --创建一张借记卡 function _Account:new( tb ) local _Tb = tb or {} setmetatable(_Tb, self) sel ...