---
# System prepended metadata

title: 3-5 =不是等號
tags: [DICE C]

---

---
tags: DICE C
---

3-5 =不是等號
===

> [name=CHAWTeam] [time=Feb 15, 2022]

---

目錄：[DICE C語言程式破解](https://hackmd.io/@CHAWTeam/DiceC)
上一篇：[3-4 整數與浮點數](https://hackmd.io/@CHAWTeam/DiceC-3-4)
下一篇：[3_1 印出2個指定的整數](https://hackmd.io/@CHAWTeam/DiceC-3_1)

---

題目
---

```!
給定a=5，b=10，請輸出執行下列程式以後a與b的值。

a=b;
b=a;

輸出範例:
10 10
```

程式碼
---

### 範例1

```c=
#include <stdio.h>
int main()
{
    int a = 5, b = 10;
    a = b, b = a; //將b存入a後，a為10，再把a存入b，b也為10
    printf("%d %d", a, b);
    return 0;
}
```

### 範例2

```c=
#include <stdio.h>
int main()
{
    int a = 5;
    int b = 10;
    a = b;
    b = a;
    printf("%d %d", a, b);
    return 0;
}
```

輸出
---

```!
10 10
```

---

[查看我們在HackMD上的所有筆記](https://hackmd.io/@CHAWTeam)
目錄：[DICE C語言程式破解](https://hackmd.io/@CHAWTeam/DiceC)
上一篇：[3-4 整數與浮點數](https://hackmd.io/@CHAWTeam/DiceC-3-4)
下一篇：[3_1 印出2個指定的整數](https://hackmd.io/@CHAWTeam/DiceC-3_1)

---

{%hackmd Iiu5mOixR7yWkPHKCkabBg %}
<iframe class="LikeCoin" height="235" src="https://button.like.co/in/embed/chawteam/button?referrer=https://hackmd.io/@CHAWTeam/DiceC-3-5" width="100%"></iframe>

---

{%hackmd i1nMRrZcTFmTvoF897K9zg %}