其他分享
首页 > 其他分享> > 37_Go基础_1_4 iota

37_Go基础_1_4 iota

作者:互联网

 1 package main
 2 
 3 import "fmt"
 4 
 5 func main() {
 6     const (
 7         A = iota   // 0
 8         B          // 1
 9         C          // 2
10         D = "haha" // iota = 3
11         E          // haha iota = 4
12         F = 100    // iota =5
13         G          // 100 iota = 6
14         H = iota   // 7
15         I          // iota 8
16     )
17     const (
18         J = iota // 0
19     )
20     fmt.Println(A)
21     fmt.Println(B)
22     fmt.Println(C)
23     fmt.Println(D)
24     fmt.Println(E)
25     fmt.Println(F)
26     fmt.Println(G)
27     fmt.Println(H)
28     fmt.Println(I)
29     fmt.Println(J)
30 }

 

标签:const,haha,fmt,37,Println,Go,main,iota
来源: https://www.cnblogs.com/luwei0915/p/15617497.html