# 3分計畫 | | 技巧 | 練習題目 | | | ------ | ---- | -------- | --- | | 第一周 | 模板 | (https://zerojudge.tw/ShowProblem?problemid=a001) | | | 第二周 | C++語法| 無 | | ## 第一周(模板) ``` #include<bits/stdc++.h> ``` :::success 不管怎樣第一行打這個就對了 包含所有含式庫 ex: <vector><iostream> ::: ``` using namespace std; ``` :::success 第二行打個個! 用來優化C++ ::: ``` typedef long long ll; ``` :::success 用來把long long 簡化成ll; ::: ### 主程式 int main(){ 要寫的程式碼 } ## 第二周(基本語法) :::warning 幾乎所有程式碼的尾巴都要加上像句點一樣的分號; ::: ### 基本判斷 在程式語言中,一個等於不是等於,等於等於才是等於 :::info 例如 ``` int a; a=10; ``` 這裡的=是把10傳給a ```if(a==1)``` 這裡的=是判斷a是否等於1,也就是數學中的= ::: ### 加減乘除 ``` a+b; a-b; a*b; 除法比較特別 ``` ### 宣告函數 ``` int a (正常整數) double a char a long long a (超大整數) bool a (小數) const a (沒限制) ```
×
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