TelenkovDmitry 1 ngày trước cách đây
mục cha
commit
ae9848c097
2 tập tin đã thay đổi với 36 bổ sung18 xóa
  1. 36 0
      go/stepik/course_2/condition/main.go
  2. 0 18
      go/stepik/course_2/condition/switch.go

+ 36 - 0
go/stepik/course_2/condition/main.go

@@ -0,0 +1,36 @@
+package main
+
+import (
+	"fmt"
+)
+
+func main() {
+	month()
+	/*
+		var month int
+		fmt.Scan(&month)
+		switch month {
+		case 1, 3, 5, 7, 8, 10, 12:
+			fmt.Println(31)
+		case 4, 6, 9, 11:
+			fmt.Println(30)
+		case 2:
+			fmt.Println(29)
+		}
+	*/
+}
+
+func month() {
+	var month int
+	fmt.Scan(&month)
+	switch month {
+	case 12, 1, 2:
+		fmt.Print("Зима")
+	case 3, 4, 5:
+		fmt.Print("Весна")
+	case 6, 7, 8:
+		fmt.Print("Лето")
+	case 9, 10, 11:
+		fmt.Print("Осень")
+	}
+}

+ 0 - 18
go/stepik/course_2/condition/switch.go

@@ -1,18 +0,0 @@
-package main
-
-import (
-	"fmt"
-)
-
-func main() {
-	var month int
-	fmt.Scan(&month)
-	switch month {
-	case 1, 3, 5, 7, 8, 10, 12:
-		fmt.Println(31)
-	case 4, 6, 9, 11:
-		fmt.Println(30)
-	case 2:
-		fmt.Println(29)
-	}
-}