#CCBCHBA0000118. Tháp sao cân đối (Centered Star Pyramid)
Tháp sao cân đối (Centered Star Pyramid)
Centered Star Pyramid
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
Given , print a centered pyramid of exactly rows. Row (1-based) starts with spaces followed by asterisks. Do not add trailing spaces; end each row with a newline.
Input
One line contains integer .
Output
Print exactly pyramid rows.
Subtasks
-
Subtask 1 (20%): .
-
Subtask 2 (30%): .
-
Subtask 3 (50%): .
Examples
Example 1
Input:
1
Output:
*
Explanation:
Each row has n-i leading spaces and 2i-1 stars.
Example 2
Input:
4
Output:
*
***
*****
*******
Explanation:
Each row has n-i leading spaces and 2i-1 stars.