Skip to content

Instantly share code, notes, and snippets.

@jtprogru
Created May 12, 2022 20:08
Show Gist options
  • Save jtprogru/d1240d6e29abb9f46ade31ccb63491c1 to your computer and use it in GitHub Desktop.
Save jtprogru/d1240d6e29abb9f46ade31ccb63491c1 to your computer and use it in GitHub Desktop.
Напишите программу, принимающая на вход число N(N≥4), а затем N целых чисел-элементов среза. На вывод нужно подать 4-ый (3 по индексу) элемент данного среза.
package main
import "fmt"
func main() {
var inputNumber int
_, _ = fmt.Scan(&inputNumber)
inputArray := make([]int, inputNumber)
_, _ = fmt.Scan(&inputArray)
for i := 0; i < inputNumber; i++ {
_, _ = fmt.Scan(&inputArray[i])
}
fmt.Println(inputArray[3])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment