--- ###### 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  ## operation | Add | subraction | Multiplication | Division | Remainder | |:---:|:----------:|:--------------:|:--------:|:---------:| | + | - | * | / | % | ### Precedence 1.`()` 2. `*` `/` `%` 3. `+` `-` ## Operator 
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up