---
# System prepended metadata

title: 2-3 印三角形
tags: [DICE C]

---

---
tags: DICE C
---

2-3 印三角形
===

> [name=CHAWTeam] [time=Jun, 2022]

---

目錄：[DICE C語言程式破解](https://hackmd.io/@CHAWTeam/DiceC)
上一篇：[2-2 SayHello](https://hackmd.io/@CHAWTeam/DiceC-2-2)
下一篇：[2-4 不是計算](https://hackmd.io/@CHAWTeam/DiceC-2-4)

---

題目
---

```!
寫一個程式，印出以下結果：

輸出範例:
*
**
***
****
*****
******
```

程式碼
---

### 範例1

```cpp=
#include <stdio.h>
int main ()
{
    printf("*\n**\n***\n****\n*****\n******"); //「\n」意旨換行
    return 0;
}
```

### 範例2

```c=
#include <stdio.h>
int main()
{
    printf("*\n"); //「\n」意旨換行
    printf("**\n");
    printf("***\n");
    printf("****\n");
    printf("*****\n");
    printf("******\n");
    return 0;
}
```

輸出
---

```!
*
**
***
****
*****
******
```

---

[查看我們在HackMD上的所有筆記](https://hackmd.io/@CHAWTeam)
目錄：[DICE C語言程式破解](https://hackmd.io/@CHAWTeam/DiceC)
上一篇：[2-2 SayHello](https://hackmd.io/@CHAWTeam/DiceC-2-2)
下一篇：[2-4 不是計算](https://hackmd.io/@CHAWTeam/DiceC-2-4)

---

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

---

{%hackmd i1nMRrZcTFmTvoF897K9zg %}