Created
May 13, 2022 14:58
-
-
Save jtprogru/580afba32788812f3851091b1a203067 to your computer and use it in GitHub Desktop.
По данным числам, определите количество чисел, которые равны нулю. Вводится натуральное число N, а затем N чисел. Выведите количество чисел, которые равны нулю.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
var inputNumber int | |
var counter int | |
_, _ = fmt.Scan(&inputNumber) | |
inputArray := make([]int, inputNumber) | |
for i := 0; i < inputNumber; i++ { | |
_, _ = fmt.Scan(&inputArray[i]) | |
if inputArray[i] == 0 { | |
counter += 1 | |
} | |
} | |
fmt.Println(counter) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment