Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void draw(int k, int n)
- {
- for (int i = 0; i < n; i++)
- {
- if ( i < n - k )
- cout << " ";
- else
- cout << "*";
- }
- cout << "\n";
- if (n == k) return;
- draw((++k), n);
- }
- int main (void)
- {
- int n;
- cin >> n;
- draw(1,n);
- }
Advertisement
Add Comment
Please, Sign In to add comment