I come, I see, I conquer

                    —Gaius Julius Caesar

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
复制代码
/************************************************************************
*
*  1024! 末尾有多少个0 ? 
*
/***********************************************************************
*/
#include 
<stdio.h>

int totalzero(int n)
{
    
int total = 0;
    
while (n > 5)
    {
        n 
= (n - (n % 5)) / 5;
        total 
+= n;
    }
    
return total;
}

void main()
{
    printf(
"%d\n", totalzero(1024));
}
复制代码
posted on   jcsu  阅读(619)  评论(0)    收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示