Section10-82
This commit is contained in:
22
Section10/81.go
Normal file
22
Section10/81.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
numbers := []int{2, 3}
|
||||
|
||||
numbers = append(numbers, 10)
|
||||
fmt.Println(numbers)
|
||||
|
||||
numbers = append(numbers, 20, 30, 40)
|
||||
fmt.Println(numbers)
|
||||
|
||||
n := []int{100, 200}
|
||||
numbers = append(numbers, n...)
|
||||
fmt.Println(numbers)
|
||||
|
||||
src := []int{10, 20, 30}
|
||||
dst := make([]int, len(src))
|
||||
nn := copy(dst, src)
|
||||
fmt.Println(src, dst, nn)
|
||||
}
|
||||
Reference in New Issue
Block a user