Incremental Number Triangle


Submit solution

Points: 10
Time limit: 1.0s
Memory limit: 10M

Author:
Problem type

Description

請撰寫一個程式,輸入一個正整數 n,並使用 for loop 印出一個由數字組成的三角形。

Requirements

  1. 輸入

    • 一個正整數 n
  2. 輸出

    • 1 行輸出 1
    • 2 行輸出 1 2
    • 3 行輸出 1 2 3
    • 每一行從 1 印到該行的行數,依此類推,直到第 n

Input and Output

Sample 1 Sample 2 Sample 3
INPUT 3 5 1
OUTPUT 1
1 2
1 2 3
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
1

Comments

There are no comments at the moment.