#include <stdio.h> int main() { int i, count; for(i = 5; i <= 100; i += 5) //循环以5开始,5的倍数为步长 { count++; //若为5的倍数,计数器加1 if(i%25 == 0) count++; //若为25的倍数,计数器再加1 } printf("The number of 0 in the end of 100! is %d.\n",count); return 0; }
The number of 0 in the end of 100! is 24.