Last active
November 2, 2016 12:10
-
-
Save aadimator/29ed4b3ee78458c52f96aafc27d4935c to your computer and use it in GitHub Desktop.
Staircase - https://www.hackerrank.com/challenges/staircase
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
using namespace std; | |
int main(){ | |
int n; | |
cin >> n; | |
for (int i = 1; i <= n; i++) { | |
string output = string(n - i, ' '); | |
output += string(i, '#'); | |
cout << output << endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment