or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
程式基礎概念
基本格式與輸出
試著練習MDjudge上的A001
換行
試著練習MDjudge上的A002
變數型態
EXAMPLES
integer(整數):0、-1、99
double(浮點數):1.83、-0.06、5.0
char(字元):'a'、'D'、'5'、'%'
string(字串):"Hello World!"
bool(布林值):true、false
integer(整數) 在程式中會寫成int
知道了變數型態
那就來創造變數吧!
並且來輸入數值
賦值的符號是 =
左邊放接受資料的變數,右邊放賦予的值
也可更改變數值
變數命名規則
例:1a, 2p
例:if, int… 保留字清單
變數拿來做什麼的就取什麼,
這樣自己比較好懂
到後面會有很多變數
試著練習MDjudge上的A003
算數運算符號
+:加法
-:減法
*:乘法
/:除法
%:取餘數
除法比較特殊
試著練習MDjudge上的A004