package main

import "fmt"

func main() {
	const (
		a = iota //0
		b        //1
		c        //2
		d = "ha" //独立值,iota += 1
		e        //"ha"   iota += 1
		f = 100  //iota +=1
		g        //100  iota +=1
		h = iota //7,恢复计数
		i        //8
	)
	fmt.Println(a, b, c, d, e, f, g, h, i)
}

 输出结果:

0 1 2 ha ha 100 100 7 8

相关文章:

  • 2022-12-23
  • 2021-09-04
  • 2021-10-21
  • 2022-12-29
  • 2021-11-04
  • 2021-08-27
  • 2022-12-23
  • 2021-11-23
猜你喜欢
  • 2022-02-03
  • 2021-08-09
  • 2022-12-23
  • 2022-12-23
  • 2022-01-26
  • 2022-12-23
相关资源
相似解决方案