Ask for 100000000! how many 0s at the end

**@Seeking 100000000! how many 0s at the end

/ Ask for 100000000! How many 0s at the end
can multiply two numbers to get 0?
It can only be 2
5 because the number of 2 is far more than 5
, so it is only necessary to count the number of 5
*/
#include <stdio.h>
int main()
{ int x = 5; int num; int sum = 0; for ( ; x <= 100000000; x = x + 5) { num = x; while (num % 5 == 0) { sum++; num = num / 5;









			}
		
	}
printf("%d\n",sum);

}**

Guess you like

Origin blog.csdn.net/weixin_45042308/article/details/114574887