Hdu--N!--1042
来源:互联网 发布:dnf刷称号软件 编辑:程序博客网 时间:2024/05/22 12:37
N!
Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 43577 Accepted Submission(s): 12239
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
123
Sample Output
126import java.math.BigInteger;import java.util.Scanner;public class dashu {public static void main(String[] args) {Scanner input = new Scanner(System.in);while(input.hasNext()){BigInteger n = input.nextBigInteger();BigInteger sum = BigInteger.valueOf(1);for(BigInteger i=BigInteger.valueOf(1); ; i=i.add(BigInteger.valueOf(1))){if(i.compareTo(n)>0){break;}sum = sum.multiply(i);}System.out.println(sum.toString());}}}
- N! ---HDU 1042
- HDU 1042 N!
- hdu 1042 N!
- HDU 1042 N!
- HDU 1042 N!
- hdu 1042 N!
- hdu 1042 N!
- HDU 1042 - N!
- hdu 1042 N!
- hdu 1042 N!
- HDU 1042 N!
- hdu 1042 N!
- HDU 1042 N!
- HDU 1042 N!
- Hdu 1042 - N!
- hdu 1042 N!
- hdu 1042 N!
- hdu 1042 N!
- 在Eclipse中运行第一个MapReduce程序
- Android 保存联系人,包括部门\职位\传真\地址\照片
- ubuntu 系统网络问题
- Android MD5加密
- 在Struts2中定义自己的Interceptor
- Hdu--N!--1042
- UVA 10010 - Where's Waldorf? 水题一道
- 连接各种数据库方式速查表
- java中timer的使用
- HDU 1996汉诺塔VI
- iOS ASIHTTPRequest详解
- Web开发之一:Web UI技术综述
- Win 2K的磁盘空间配额管理及分配方法
- UVa 11234 - Expressions