Cerinta completa

Staircase detail

This is a staircase of size :

   #
  ##
 ###
####

Its base and height are both equal to . It is drawn using # symbols and spaces. The last line is not preceded by any spaces.

Write a program that prints a staircase of size .

Function Description

Complete the function with the following parameter(s):

  • : an integer

Print

Print a staircase as described above. No value should be returned.
Note: The last line is not preceded by spaces. All lines are right-aligned.

Input Format

A single integer, , denoting the size of the staircase.

Constraints

.

Sample Input

6 

Sample Output

     #
    ##
   ###
  ####
 #####
######

Explanation

The staircase is right-aligned, composed of # symbols and spaces, and has a height and width of .


Limbajul de programare folosit: python3

Cod:

import sys

data = sys.stdin.read().strip().split()
if not data:
    raise SystemExit
n = int(data[0])
for i in range(1, n+1):
    print(' ' * (n - i) + '#' * i)

Scor obtinut: 1.0

Submission ID: 464552216

Link challenge: https://www.hackerrank.com/challenges/staircase/problem

Staircase