Last active
May 2, 2017 07:21
-
-
Save artivnv/49ab6a7cb33e4728913f3491cb06c43b to your computer and use it in GitHub Desktop.
This file contains 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() { | |
numbers := []int{1, 2, 6, 4, 5, 7, 8, 9, 5, 6, 3, 1, 5, 7, 2, 8, 4, 6, 7, 8, 3, 4, 2, 5} | |
fmt.Print("Введите число: ") | |
var n, a int | |
fmt.Scanln(&n) | |
for _, number := range numbers { | |
if number == n { | |
a++ | |
} | |
} | |
fmt.Println("Таких чисел в массиве", a, "шт.") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment