---
# System prepended metadata

title: 14-3 印N次
tags: [DICE C]

---

---
tags: DICE C
---

14-3 印N次
===

> [name=CHAWTeam]

---

目錄：[DICE C語言程式破解](https://hackmd.io/@CHAWTeam/DiceC)

---

題目
---

```!
寫一個程式，我說幾次，就印幾次「HaHaHa!」。

輸入範例:
12

輸出範例:
HaHaHa!
HaHaHa!
HaHaHa!
HaHaHa!
HaHaHa!
HaHaHa!
HaHaHa!
HaHaHa!
HaHaHa!
HaHaHa!
HaHaHa!
HaHaHa!
```

程式碼
---

```c=
#include <stdio.h>

int main()
{
    int i = 0, a;
    scanf("%d", &a);
    while (i < a)
    {
        printf("HaHaHa!\n");
        i++;
    }
    return 0;
}
```

輸出
---

```!
12
HaHaHa!
HaHaHa!
HaHaHa!
HaHaHa!
HaHaHa!
HaHaHa!
HaHaHa!
HaHaHa!
HaHaHa!
HaHaHa!
HaHaHa!
HaHaHa!
```

---

[查看我們在HackMD上的所有筆記](https://hackmd.io/@CHAWTeam)
目錄：[DICE C語言程式破解](https://hackmd.io/@CHAWTeam/DiceC)

---

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

---

{%hackmd i1nMRrZcTFmTvoF897K9zg %}