Seal_of_approval

p39e11

Mar 1st, 2015
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void draw(int k, int n)
  5. {
  6. for (int i = 0; i < n; i++)
  7. {
  8. if ( i < n - k )
  9. cout << " ";
  10. else
  11. cout << "*";
  12. }
  13. cout << "\n";
  14. if (n == k) return;
  15. draw((++k), n);
  16. }
  17.  
  18. int main (void)
  19. {
  20. int n;
  21. cin >> n;
  22. draw(1,n);
  23. }
Advertisement
Add Comment
Please, Sign In to add comment