Staircase
Solutions This exercise is very easy. At Coding Gym we experiment with such exercises to learn more.
Some solutions follow.
C++:
1 2 3 4 5 int N; cin >> N; for (auto i=1; i<=N; ++i) { cout << string(N-i, ' ') << string(i, '#') << endl; } C#:
1 2 3 int n = Convert.ToInt32(Console.ReadLine()); for (int i = 1; i <= n; i++) Console.WriteLine(new String(' ', n - i) + new String('#', i)); Python:
[Read More]