diff --git a/go/l3.go b/go/l3.go new file mode 100644 index 0000000..149e8fb --- /dev/null +++ b/go/l3.go @@ -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]) +} diff --git a/go/output/l3 b/go/output/l3 new file mode 100755 index 0000000..d57c445 Binary files /dev/null and b/go/output/l3 differ