mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 01:55:35 +08:00
05.0.md
This commit is contained in:
16
eBook/examples/chapter_5/switch1.go
Normal file
16
eBook/examples/chapter_5/switch1.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
var num1 int = 100
|
||||
|
||||
switch num1 {
|
||||
case 98, 99:
|
||||
fmt.Println("It's equal to 98")
|
||||
case 100:
|
||||
fmt.Println("It's equal to 100")
|
||||
default:
|
||||
fmt.Println("It's not equal to 98 or 100")
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user