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. spring注入对象类型的属性

    一.1.创建service类和Dao类 (1)在service中得到dao对象 2.具体实现过程 (1)在service里边把dao作为类型属性 (2)生成dao类型属性的set方法 public c ...

  2. 部署微信定位精灵APK到Genymotion

  3. docker(部署常见应用):docker部署redis

    上节回顾:docker(部署常见应用):docker部署mysql docker部署redis:4.0 # 下载镜像 docker pull redis:4.0 # 查看下载镜像 docker ima ...

  4. html基础知识整理

    html 标题 <h1>这是一级标题</h1> <h2>这是二级标题</h2> <h3>这是三级标题</h3> html注释: ...

  5. TensorFlow-LSTM序列预测

    问题情境:已知某一天内到目前为止股票各个时刻的价格,预测接下来短时间内的价格变化. import tushare as ts import time from collections import n ...

  6. idiom的学习笔记(一)、三栏布局

    三栏布局左右固定,中间自适应是网页中常用到的,实现这种布局的方式有很多种,这里我主要写五种.他们分别是浮动.定位.表格.flexBox.网格. 在这里也感谢一些老师在网上发的免费教程,使我们学习起来更 ...

  7. DevExpress 如何读取当前目录下文件,加载至grid

    DBFileName=DevExpress.Utils.FileHelper.FindingFileName(Appliaction.StartupPath,"Data\\Product&g ...

  8. Map使用操作系统内存的情况

    public static void main(String[] args) { System.out.println("程序启动-->可用内存:"+(getSystemMe ...

  9. Exact Change FreeCodeCamp

    function checkCashRegister(price, cash, cid) { var change; var sumCid = 0; // Here is your change, m ...

  10. bzoj 4372: 烁烁的游戏 动态点分治_树链剖分_线段树

    [Submit][Status][Discuss] Description 背景:烁烁很喜欢爬树,这吓坏了树上的皮皮鼠. 题意: 给定一颗n个节点的树,边权均为1,初始树上没有皮皮鼠. 烁烁他每次会跳 ...