mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 00:11:36 +08:00
按照程序输出是没output的
This commit is contained in:
@@ -73,7 +73,7 @@ func main() {
|
||||
|
||||
输出:
|
||||
|
||||
Output: "It's equal to 100"
|
||||
It's equal to 100
|
||||
|
||||
在第 12.1 节,我们会使用 switch 语句判断从键盘输入的字符(详见第 12.2 节的 switch.go)。switch 语句的第二种形式是不提供任何被判断的值(实际上默认为判断是否为 true),然后在每个 case 分支中进行测试不同的条件。当任一分支的测试结果为 true 时,该分支的代码会被执行。这看起来非常像链式的 `if-else` 语句,但是在测试条件非常多的情况下,提供了可读性更好的书写方式。
|
||||
|
||||
@@ -126,7 +126,7 @@ func main() {
|
||||
|
||||
输出:
|
||||
|
||||
Output: Number is between 0 and 10
|
||||
Number is between 0 and 10
|
||||
|
||||
switch 语句的第三种形式是包含一个初始化语句:
|
||||
|
||||
|
Reference in New Issue
Block a user