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 2011-04-16 08:41  jcsu  阅读(615)  评论(0编辑  收藏  举报