1 //n!的末尾有几个0,其实就是求5的倍数有几个,25的倍数有几个,…… 2 int f(int n) 3 { 4 int num=0; 5 while(n){ 6 num+=n/5; 7 n/=5; 8 } 9 return num; 10 }
末尾有几个0
猜你喜欢
转载自www.cnblogs.com/tingtin/p/9420629.html
今日推荐
周排行