# If else

If 是一個判別邏輯的程式，可以讓程式在某些情況下執行。

<img src="/files/b0JRsp3CoE3xddll8KOe" alt="" class="gitbook-drawing">

## Example:

```cpp
bool no_idea;

if (no_idea) {
    keep_learning();
} else {
    make_design();
}
```

if else statement 也可以是更複雜的結構：

```cpp
int days_before_vacation;

if (days_before_vacation > 5) {
    printf("days_before_vacation is more than 5\n");
}
else if (days_before_vacation > 3) {
    printf("days_before_vacation is between 4 and 5\n");
}
else if (days_before_vacation > 1) {
    printf("days_before_vacation is between 2 and 3\n");
}
else {
    printf("days_before_vacation is 1 or less\n");
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://acezxn.gitbook.io/vex-ji-qi-ren-cheng-shi-jiao-xue/ji-chu-jiao-xue/luo-ji-kong-zhi/if-else.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
