N!的位数
来源:互联网 发布:python画图代码 编辑:程序博客网 时间:2024/05/17 02:03
数学规律:
N!的位数 n =(lg1+lg2+┈┈+lgN)+1;
对(lg1+lg2+┈┈+lgN)取整数部分;
#include <iostream>#include <cstdio>#include <string>#include <cstdio>#include <cstring>#include <algorithm>#include <iomanip>#include <cmath>using namespace std;int main(){ int n; while(cin>>n){ double sum=0; for(int i=1;i<=n;i++) sum+=log10(i); cout<<(int)sum+1<<endl; } return 0;}
阅读全文
0 0
- n^n的第一位数
- N^N的第一位数
- N!的位数
- 求N!的位数
- 求N!的位数
- N!的位数
- n!结果的位数
- 计算n!的位数
- 求N!的位数
- n!的位数
- N!的位数
- N!的位数
- n的阶乘的位数
- 求大数n!的位数
- PKU1423:求n!的位数。
- POJ_1423_Big Number(n!的位数)
- 高精度之 N!的位数
- 计算n!的位数<Math>
- 数据结构关于树的一些递归函数代码
- redis-cluster研究和使用
- CF
- centos6.5下zabbix3.26搭建
- Codeforces 249E:Endless Matrix
- N!的位数
- ArcGIS水文分析实战教程(1)GIS与水文学
- mechaware——理解事件确认
- Linux内核内存管理之SLAB内存管理算法(三) --slab对象的分配与释放
- Hadoop之旅(2)—伪集群 HDFS 文件读取与上传案例、权限与安全模式
- Activity的启动模式和退出
- TCP与UDP区别总结
- React Native实现微信好友/朋友圈分享功能-Android/iOS双平台通用
- 计算机网络总结之物理层