add new file go/l3.go and binary file go/output/l3 for easy question

This commit is contained in:
root 2026-06-01 04:21:38 +03:00
parent b00ae9819d
commit 020be27e57
2 changed files with 23 additions and 0 deletions

23
go/l3.go Normal file
View file

@ -0,0 +1,23 @@
package main
import (
"fmt"
)
func main() {
fmt.Println("Сколько")
var pol string
fmt.Scanln(&pol)
fmt.Println("Кому?")
var pol2 string
fmt.Scanln(&pol2)
var sergay []string
sergay = append(sergay, pol2, pol)
if sergay[1] == "31" || sergay[1] == "21" || sergay[1] == "41" || sergay[1] == "51" || sergay[1] == "61" || sergay[1] == "71" || sergay[1] == "81" || sergay[1] == "91" || sergay[1] == "101" {
sergay = append(sergay, "год")
} else {
sergay = append(sergay, "лет")
}
fmt.Println(sergay[0], sergay[1], sergay[2])
}

BIN
go/output/l3 Executable file

Binary file not shown.