zoj_1526 Big Number
2013-05-27 23:37
274 查看
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=526
//C++代码 //log10(n!)=log10(1)+log10(2)+...+log10(n) #include<iostream> #include<cmath> using namespace std; int main(){ int t,n,i; cin>>t; while(t--){ cin>>n; double sum=0; for(i=2;i<=n;i++) sum+=log10(i); cout<<(int)sum+1<<endl; } return 0; }
相关文章推荐
- ZOJ 2760 最短路径条数问题
- ZOJ-3123
- ZOJ 3872 Beauty of Array(数学啊)
- ZOJ--1091:Knight Moves(dfs)
- ZOJ 3605 Find the Marble
- ZOJ-2645
- 【ZOJ】3874 Permutation Graph 【FFT+CDQ分治】
- UVALive2288 POJ1050 HDU1081 ZOJ1074 To The Max【最大子段和+DP】
- ZOJ Problem Set - 3607 Lazier Salesgirl
- zoj 3171 The Hidden 7's
- zoj 2913 Bus Pass
- ZOJ --- 2974 倒水 【思维 + 矩阵快速幂】
- ZOJ1260 POJ1364 HDU1531 King
- ZOJ 3469 区间dp
- zoj 3870
- ZOJ 3822 Domination【概率DP】
- zoj 2971 Give Me the Number
- zoj(1586)最小生成树
- ZOJ 2334 HDU 1512 Monkey King
- zoj 2100 dfs暴力宽搜