You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lavos/cap3/work11.go

14 lines
220 B

7 months ago
package cap3
// Work11 求n!结果中0的数量
func Work11(n int) int {
count := 0
for i := 1; i <= n; i++ {
for num := i; num%5 == 0; num /= 5 {
count++
}
}
return count
}