Right-Aligned Stars
InterviewTime limit1sMemory limit128 MB
Print N lines of right-aligned stars, where line i has i stars padded with leading spaces to align the right edge.
- Level
Easy2 of 10
- Topics
- Implementation, Simulation
- Solved
- No attempts yet
Problem
Given an integer N, print 1 star on the first line, 2 stars on the second line, and N stars on the N-th line.
Pad each line with leading spaces so the right edge of every row is aligned.
Input
The first line contains an integer N. (1 ≤ N ≤ 100)
Output
Print the right-aligned stars in order from the first line through the N-th line.