package main
import "fmt"
/*
常量,变量,表达式
*/
func main021() {
/*
一次性声明多个常量
一次性声明多个变量
*/
}
func main() {
fmt.Println( "我又活过来了")
// main021()
const (
lightSpeed = 30 * 10000
earthCircle = 40000
)
fmt.Println("光速常量是",lightSpeed,"地球常量周长是",earthCircle)
//一次性声明多个变量
var (
age= 20
height = 175
weight = 60
)
fmt.Println( "年龄变量是",age,"身高变量是",height,"体重变量是",weight)
/*修改变量的值*/
age = 30
height = 175
weight = 80
fmt.Println( "年龄变量是",age,"身高变量是",height,"体重变量是",weight)
}
网友评论