---
# System prepended metadata

title: 114 程式設計實習I (資訊一乙) Week01 作業

---

# 114 程式設計實習I (資訊一乙) Week01 作業
## [Hashmat the Brave Warrior](https://oj.fcu.edu.tw/problem/Uva10055)

### Description

Hashmat是一個勇敢的將領，他帶著年輕的士兵從這個城市移動到另一個城市與敵人對抗。在打仗之前他會計算己方與敵方士兵的數目差距，來決定是要開打或不開打。Hashmat的士兵數絕不會比敵人的士兵數大。

Hashmat is a brave general who leads young soldiers from one city to another to confront the enemy. Before the battle, he calculates the difference in the number of soldiers between his army and the enemy's to decide whether to engage in the fight or not. The number of Hashmat's soldiers is never greater than that of the enemy.(ChatGPT translate)

### Input

每組測試資料1列，有2個整數，代表Hashmat及敵人的士兵數或反之。這些數不會超過263。

Each test case consists of one line with two integers, representing the number of soldiers of Hashmat and the enemy, or vice versa. These numbers will not exceed 263.(ChatGPT Translate)

### Output

對每組測試資料請輸出Hashmat與敵人士兵數目的差（正數）。

For each test case, output the absolute difference between the number of soldiers of Hashmat and the enemy.(positive number) (ChatGPT Translate)

### Sample Input 1

```c
10 12
14 10
```

### Sample Output 1

```c
2
4
```

### Hint
1. 可以使用 `abs()` 與算術運算子完成

2. 輸入的部分並非每次皆為 2 筆輸入，可能為多筆，因此請使用 while 與 EOF
    ```c
    while (scanf("%d %d", &a, &b) != EOF) {
        判斷程式碼
    }
    ```
    [可參考筆記](https://ithelp.ithome.com.tw/articles/10283233)


## 作業繳交方式 Assignment Submission Instructions
* 交至ilearn作業繳交區
* 原始碼檔名以 學號_題號.c 命名 (example. D1109070_01.c)
* 僅一個檔案上傳(限定 C 語言)
* [作業網址](https://oj.fcu.edu.tw/problem/Uva10055)

* Submit to the iLearn assignment submission area
* Name the source code file as **StudentID\_ProblemNumber.c** (example: D1109070\_01.c)
* Only one file should be uploaded (C language only)
* [Assignment link](https://oj.fcu.edu.tw/problem/Uva10055)