nefu 118——n!后面有多少个0
来源:互联网 发布:信捷plc流程梯图编程 编辑:程序博客网 时间:2024/05/01 20:00
思路:计算n!的素因子分解中的5的幂
代码如下:
#include<iostream>#include<cstdio>using namespace std;int main(){ int m; scanf("%d",&m); while(m--){ int n; scanf("%d",&n); int tmp=5; int ans=0; while(tmp<=n){ ans=ans+n/tmp; tmp=tmp*5; } printf("%d\n",ans); } return 0;}
0 0
- nefu 118——n!后面有多少个0
- NEFU 118 n!后面有多少个0(数论)
- NEFU 118 n!后面有多少个0
- 【Eternallyc】NEFU-118-n!后面有多少个0
- NEFU 118 n!后面有多少个0 n!素因子的分解
- NEFU 118 n!后面有多少个0 (n!的素因子幂问题)
- nefu 118 n!后面有多少个0 算数基本定理,素数分解
- Nefu 118 n!后面有多少个0【算术基本定理应用】n!素因子幂次
- n!后面有多少个0
- n!后面有多少个0
- n!后面有多少个0
- n!后面有多少个0(转载)
- n!后面有多少个0
- n!后面有多少个0
- n!后面有多少个0
- nefu 753 n!末尾有多少个0
- N!后面有多少0
- 求 n!的后面有多少个 0
- Linux中profile、bashrc、bash_profile之间的区别和联系
- linux常用命令
- Eclipse下建立geoserver源码工程
- uva 10878 Decode the tape(字符密码推断)
- 标准为王
- nefu 118——n!后面有多少个0
- nginx 设置本地浏览器缓存文件,nginx gzip压缩
- 总结wordpress3.9版本运行缓慢的几种解决方案
- UVa 846 - Steps
- CentOS 6.5安装NodeJS
- 学习Linux的菜鸟(DNS服务器的安装与配置)
- lua学习笔记04
- using localhost.localdomain for ServerName
- OpenCV-1 我的积累和点滴