![]() |
[求助]n!中末尾0的个数
编写函数文件,参数为整数n,返回值为:n!尾部0的个数。
我编写的是: n=('please input n='); s=0; m=fix(log(n)/log(5)); for t=1:n for k=1:m if n/(5.^k)==round(n/(5.^k)) s=s+1; end end end 不知道哪里出错了 |
所有时间均为北京时间。现在的时间是 13:15。 |
Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.