logo

if语句运行实例代码
go语言if语句代码结构实例
package main

import "fmt"

func main() {
 num := 30
 if num%2 == 0 {
  fmt.Println(num, "偶数")
 } else {
  fmt.Println(num, "奇数")
 }
}