<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                [TOC] ## **1.1變量介紹:** 概念:變量相當于內存一個數據存儲空間的表示,可以把變量看成一個門牌號,通過門牌號我們可以找到房間,同樣的道理,通過變量名我們可以找到具體的值 ## **1.2常量介紹:** 1)常量使用**const**修改 2)常量在定義的時候,必須初始化(也就是在定義時必須有值) 3)**常量不能修改** 4)常量只能修飾**bool**、數值類型(**int, float系列**)、 **string**類型 ![](https://img.kancloud.cn/87/d4/87d4949bf1abe6f6df417b7ca04c4685_1110x489.png) <br> <br> 語法: `const identifier [type] = value` :-: **舉例說明**:看看下面的寫法是否正確: ![](https://img.kancloud.cn/6c/1b/6c1be9d1376fe69c95f18785b64b0234_736x463.png) ## **1.3:常量注意事項** 寫法1: ``` package main import "fmt" func main(){ const ( a = 1 b = 2 ) } ``` 寫法2: iota表示0,n也就是0,m會是1,c會是2,它會遞增,以此類推 ``` package main import "fmt" func main(){ const ( a = iota b c ) fmt.Println(a,b,c) } ``` 運行結果: `0 1 2` ``` package main import "fmt" func main(){ const ( a = iota b = iota c = iota d e = iota ) fmt.Println(a,b,c,d,e) } ``` 運行結果: `0 1 2 3 4` **注意:**如果在const中定義一個常量,如果要全局訪問,常量首**字母必須大寫**
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看