Big Number
来源:互联网 发布:擎洲软件 编辑:程序博客网 时间:2024/05/29 18:53
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
21020
Sample Output
7
19
19
#include<stdio.h>#include<math.h>int main(){int t;scanf("%d",&t);while(t--){int n,i;scanf("%d",&n);double d=0;for(i=1;i<=n;i++){d+=log10(i); }printf("%d\n",(int)d+1);}return 0;}
0 0
- big big number 求和
- big number
- Big Number
- Big Number
- big number
- Big Number
- Big Number
- Big Number
- Big Number
- Big Number
- Big Number
- Big Number
- Big Number
- Big Number
- Big Number
- Big Number
- Big Number
- Big Number
- Qt QApplication 类简介--Qt 类简介专题(四)
- java流操作对文件的分割和合并
- 关于《火星救援》
- 在C语言中执行python的环境调试和问题解决
- 第十三周项目五 拓扑排序算法验证
- Big Number
- scala:函数即对象
- C语言基础IO操作
- 女性其实最需要三种蔬菜!赶紧看看哟~~~
- ztree+java后台取数据(包括异步)生成树状图
- Qt QWidget 类简介--Qt 类简介专题(三)
- AVL树的实现
- 【博弈-找规律】HDOJ 取石子游戏 2516
- Qt Object 类简介--Qt 类简介专题(二)