ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、视频、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# 2.2、语句 语句主要分为一般语句、条件语句、循环语句、跳跃语句和异常处理语句。 **一般语句**:空语句(null statement)、表达式语句(expression statement)、组合语句(compound statement,block)。 > The simplest statement is the empty statement, also known as a **null statement**. > A **compound statement**, usually referred to as a block, is a sequence of statements and declarations surrounded by a pair of curly braces. **条件语句**:`if`,`switch`。[Reference: runoob-C++条件语句](https://www.runoob.com/cplusplus/cpp-decision.html) **循环语句**:`while`、`for`、`do while`。[Reference: runoob-C++循环语句](https://www.runoob.com/cplusplus/cpp-loops.html) **跳跃语句**:`break`、`continue`、`goto`。 > A **break** statement terminates the nearest enclosing while, do while, for, or switch statement. > A **continue** statement terminates the current iteration of the nearest enclosing loop and immediately begins the next iteration. A continue can appear only inside a for, while, or do while loop, including inside statements or blocks nested inside such loops. > A **goto** statement provides an unconditional jump from the goto to a another statement in the same function. **异常处理语句**:`try catch`、`throw`。[Reference: runoob-C++异常处理语句](https://www.runoob.com/cplusplus/cpp-exceptions-handling.html)