push all exercices

This commit is contained in:
lbenedar
2026-02-21 14:09:13 +03:00
commit a94d994b8c
72 changed files with 787 additions and 0 deletions

BIN
ch3/1/ch3_1.exe Normal file

Binary file not shown.

13
ch3/1/ch3_1.go Normal file
View File

@@ -0,0 +1,13 @@
package main
import "fmt"
func main() {
var greetings = []string{"Hello", "Hola", "नमस्कार", "こんにちは", "Привіт"}
var a = greetings[:2]
var b = greetings[1:4]
var c = greetings[3:]
fmt.Println(a)
fmt.Println(b)
fmt.Println(c)
}

3
ch3/1/go.mod Normal file
View File

@@ -0,0 +1,3 @@
module ch3_1
go 1.25.0

BIN
ch3/2/ch3_2.exe Normal file

Binary file not shown.

9
ch3/2/ch3_2.go Normal file
View File

@@ -0,0 +1,9 @@
package main
import "fmt"
func main() {
var message string = "Hi 👩 and 👨"
var msgRunes []rune = []rune(message)
fmt.Println(string(msgRunes[3]))
}

3
ch3/2/go.mod Normal file
View File

@@ -0,0 +1,3 @@
module ch3_2
go 1.25.0

BIN
ch3/3/ch3_3.exe Normal file

Binary file not shown.

29
ch3/3/ch3_3.go Normal file
View File

@@ -0,0 +1,29 @@
package main
import "fmt"
func main() {
type Employee struct {
firstName string
lastName string
id int
}
firstVal := Employee{
"Ivan",
"Ivanov",
1,
}
secondVal := Employee{
firstName: "Peter",
lastName: "Petrov",
id: 2,
}
var thirdVal Employee
thirdVal.firstName = "Sergei"
thirdVal.lastName = "Sidorov"
thirdVal.id = 3
fmt.Println(firstVal)
fmt.Println(secondVal)
fmt.Println(thirdVal)
}

3
ch3/3/go.mod Normal file
View File

@@ -0,0 +1,3 @@
module ch3_3
go 1.25.0