[1018]:Big Number
来源:互联网 发布:2015淘宝刷单处罚 编辑:程序博客网 时间:2024/05/16 13:13
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
/* author : Yangchengfeng*/#include<stdio.h>#include<math.h>int main(){ int num; while(scanf("%d", &num)!=EOF){ while(num--){ int n; scanf("%d", &n); int i = 1; double sum = 0.0; for(; i<=n; i++){ sum += log10(i); } printf("%d\n", (int)sum + 1); } } return 0;}
0 0
- hdu 1018 Big Number
- HDU 1018 Big Number
- HDOJ 1018 Big Number
- 1018 Big Number
- HDU 1018 - Big Number
- HDOJ 1018 Big Number
- hdoj 1018 Big Number
- hdu 1018 Big Number
- hdu 1018 Big Number
- HDU 1018 Big Number
- HDU 1018 Big Number
- HDU 1018 Big Number
- hdu 1018 Big Number
- 1018 Big Number
- HDOJ 1018 Big Number
- hdu 1018 Big Number
- HDU 1018 Big Number
- hdu 1018 - Big Number
- 机器学习 - K-近邻算法(KNN)
- 读《数学之美》有感(一)
- NanoPC-T2 以太网分析(2)
- ubuntu 登录慢
- HDU 1161Eddy's mistakes
- [1018]:Big Number
- HDU 5643 King's Game
- IOS学习 UITableView 用谓词过滤
- iOS证书自助管理实现思路
- 2016.3.12
- com.android.dex.DexException finished with non-zero exit value 2 等异常解决办法思路
- Codeforces 599E Sandy and Nuts 状压DP
- groovy/java自实现json解析器(1)绪论
- Nvidia Jetson TK1 无线网卡(Intel 7260)驱动及配置