Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 37630    Accepted Submission(s): 18103
Problem Description

In many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In this problem you are given a number, you have to determine the number of digits in the factorial of the number.

 
 
Input

Input consists of several lines of integer numbers. The first line contains an integer n, which is the number of cases to be tested, followed by n lines, one integer 1 ≤ n ≤ 107 on each line.

 

Output

The output contains the number of digits in the factorial of the integers appearing in the input.

 

Sample Input

2 10 20

 

Sample Output

7 19
1 #include<stdio.h>
#include<math.h>
double reback(int n)
{
double cnt=;
for(int i=;i<=n;i++)
{
cnt+=log10(i);
}
return cnt;
} int main()
{
int cas,n;
scanf("%d",&cas);
while(cas--)
{
scanf("%d",&n);
printf("%d\n",(int)reback(n)+);
}
return ;
}

1018 Big Number的更多相关文章

  1. HDU 1018 Big Number (数学题)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1018 解题报告:输入一个n,求n!有多少位. 首先任意一个数 x 的位数 = (int)log10(x ...

  2. hdu 1018:Big Number(水题)

    Big Number Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total ...

  3. HDU 1018 Big Number

    LINK:HDU 1018 题意:求n!的位数~ 由于n!最后得到的数是十进制,故对于一个十进制数,求其位数可以对该数取其10的对数,最后再加1~ 易知:n!=n*(n-1)*(n-2)*...... ...

  4. hdu 1018 Big Number (数学题)

    Problem Description Inmany applications very large integers numbers are required. Some of theseappli ...

  5. HDOJ 1018 Big Number(大数位数公式)

    Problem Description In many applications very large integers numbers are required. Some of these app ...

  6. hdu 1018 Big Number 数学结论

    Big Number Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total ...

  7. HDU 1018 Big Number【斯特林公式/log10 / N!】

    Big Number Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total ...

  8. HDU 1018 Big Number (log函数求数的位数)

    Problem Description In many applications very large integers numbers are required. Some of these app ...

  9. HDU 1018 Big Number 数学题解

    Problem Description In many applications very large integers numbers are required. Some of these app ...

随机推荐

  1. SVN操作手册(part1&part2)——SVN安装

    SVN操作手册 1.关于SVN 有一个简单但不十分精确比喻: SVN = 版本控制 + 备份服务器 简单的说,您可以把SVN当成您的备份服务器,更好的是,他可以帮您记住每次上传到这个服务器的档案内容. ...

  2. reactjs Uncaught TypeError: Cannot read property 'location' of undefined

    reactjs Uncaught TypeError: Cannot read property 'location' of undefined reactjs 路由配置 怎么跳转 不成功 国内搜索引 ...

  3. 樱花的季节,教大家用canvas画出飞舞的樱花树

    又到了樱花的季节,教大家使用canvas画出飞舞的樱花树效果. 废话少说,先看效果. 演示效果地址:http://suohb.com/work/tree4.htm 查看演示效果 第一步,我们先画出一棵 ...

  4. python3.6 简单爬虫

    # coding='UTF-8' from bs4 import BeautifulSoup # 引入beautifulsoup 解析html事半功倍 import re import urllib ...

  5. [编织消息框架][JAVA核心技术]jdk动态代理

    需要用到的工具  jdk : javac javap class 反编译 :JD-GUI http://jd.benow.ca/ import java.lang.reflect.Invocation ...

  6. ubuntu 软件安装配置使用总结(由xmind:Depends:java8-runtime but is not installed引出)

    ubuntu 软件安装总结(由xmind:Depends:java8-runtime but is not installed引出) 不知道抽什么风,这几天PC上又用起了linux操作系统.其实之前断 ...

  7. Dashboard登录成功后 RuntimeError: Unable to create a new session key.

    openstack按照官网docs部署horizon后,使用admin账号密码登录,但网页提示未知错误. 查看/var/log/httpd/error_log 提示这个:RuntimeError: U ...

  8. javascript的闭包与一次重构的感受

    有没有这么一个场景,你的一个动作需要在所有异步方法执行完毕后,再进行操作?然而你对异步方法何时执行完毕感到困扰,只能在每个方法中写回调,在回调中重复劳动? 偶然的,想起了之前经理讲过的闭包的概念,偶然 ...

  9. stl1

    #include<iostream> #include<map> #include<string> using namespace std;   map<st ...

  10. 微信小程序-实战巩固(二)

    刚刚写了小程序入门没几天,小程序就开放个人开发者资格,感觉为我而来啊 \(≧▽≦)/.迫不及待的去注册,准备将之前的处女作传上去体验一把,结果卡在了服务器配置上:免费的果然不靠谱/(ㄒoㄒ)/~~,后 ...