> For the complete documentation index, see [llms.txt](https://qcmaker.gitbook.io/documents/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://qcmaker.gitbook.io/documents/software/mixlyxi-tong-jie-shao/kongzhi/switch.md).

# switch语句简介

![图2.3-6](https://2259527808-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LSXCnLP-UwKYzUqiVCQ%2F-LU9mtZFe4rG7WymDnYv%2F-LU9n0EgCCsrhXxc9oVy%2Fimage102.jpg?generation=1545295638807210\&alt=media)

Switch语句是多分支结构，与“如果”模块类似，switch语句常与case一起使用，default表示不满足条件时，执行语句体，default常用于switch语句的最后一层判断；相当于“如果”程序块的“否则”。
