---
# System prepended metadata

title: CPE 新生手冊 ~~(荼毒版)~~

---

# CPE 新生手冊 ~~(荼毒版)~~


## 一、小黑
讀寫檔
cd ..
dir
mkdir
cls
cl

## 二、Code::Blocks
```cpp
freopen
clock
```

## 三、輸出入格式
```cpp
while(cin>>a,a){}
stringstream 
getline()
scanf("%d/%d",&m,&d)
scanf("%[^\n]+",&s)
```
## 四、LeetCode

## 五、其他
```cpp
#include "bits/stdc++.h"
for(auto&i:a)
operator overloading
vector<vector<int>>
fill
memset(a,0,sizeof(a))
assign
reserve
classcmp
[](){}
Bitwise operator
bitset<>
inf = 0x3f3f3f3f
多開空間

bool binary_search(iter begin,iter end,const T& val)
```




# 12/16 


1. Forget DevC++ 
> other choise -> CodeBlocks , VsCode


2. Code::Blocks
> freopen
> 


3. #include "bits/std.c++.h"

4. I/O tips
> while(cin>>a,a){}
stringstream
getline()
scanf("DD:MM")
scanf("%[^\n]+",&s)

5. Container 容器
> vector<int> 動態陣列
> stack<int> , queue<int>    
> set<int> , map<char,int>
> bitset<8> , pair<int,int>

6. Common funtion 
-> f(begin(),end())
-> inplace

> __gcd(a,b)
> min/max({})
> stoi、to_string、 .c_str()、-'0'

> isdigit / isalpha / isalnum / isupper / islower 
> toupper / tolower
> min_element()、max_element() 
> find()
> sort()
> reverse()
> count()
> swap()

7. Others
> data[n%10]++
> cnt += (a==10)
> n/2 = n>>1
> n%2 = n&1



8. Leetcode

