mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 03:55:28 +08:00
17 lines
292 B
Go
17 lines
292 B
Go
package main
|
|
|
|
import "fmt"
|
|
|
|
func main() {
|
|
var num1 int = 7
|
|
|
|
switch {
|
|
case num1 < 0:
|
|
fmt.Println("Number is negative")
|
|
case num1 > 0 && num1 < 10:
|
|
fmt.Println("Number is between 0 and 10")
|
|
default:
|
|
fmt.Println("Number is 10 or greater")
|
|
}
|
|
}
|