Forever
Do not lose heart,you will be successful sooner or later。

主题思想:
能被多少个5整除就有多少个零.
程序如下:
#include<iostream.h>
main()
{
    int  count=0;
      for(int i=1;i<701;i+=3;)

    {
         if(i%625==0)//625是5的四次方
count+=4;
else if(i%125==0&&i%10!=0)
count+=3;
else if(i%25==0&&i%10!=0)
count+=2;
else if(i%5==0&&i%10!=0)
count++;
else if(i%100==0)
count+=2;
else if(i%10==0)
count++; 
         

     }
cout<<"结果中有"<<count<<"个0"<<endl;

}

posted on 2008-04-05 19:36  sybtj  阅读(276)  评论(0编辑  收藏  举报