--- ###### tags: `C++` --- # Introduction ## Based C++ Structure ```c++= # include <iostream> //輸入輸出lib usigned namespace std; //沒有這個要加std::(eg. std::cout) int main() { return 0; //正常return 0 (不正常return -1) } ``` ## I/O | Input | Output | |:-----:|:------:| | cin | cout | | >> | << | ### output 1. **usage:** `cout<<` 2. | `\n` | `\t` | `\a` | `\\` | `\'` | `\"` | `\r` | |:-------:|:---:|:-----:|:-----------:|:---:|:---:|:---:| | endline | tab | alert | print `\` | print`'` | print`"` | carriage return(回車) | ### input 1. **usage:** `cin>>` 2. sucess: return cin, fail: return 0 ## Declare 1. **usage:** `(data type) variable;` 2. data type ![](https://i.imgur.com/0JQ5VEK.jpg) ## operation | Add | subraction | Multiplication | Division | Remainder | |:---:|:----------:|:--------------:|:--------:|:---------:| | + | - | * | / | % | ### Precedence 1.`()` 2. `*` `/` `%` 3. `+` `-` ## Operator ![](https://i.imgur.com/PaCPjk8.png)