Guest User

Untitled

a guest
May 20th, 2018
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4. void printStars(int count, int num);
  5. int main() {
  6. cout << "Enter the number for the largest line to print: ";
  7. int x;
  8. cin >> x;
  9. int ind = 1;
  10.  
  11. printStars(ind, x);
  12.  
  13. system("PAUSE");
  14. return 0;
  15. }
  16. void printStars(int count, int num)
  17. {
  18. for (int i = 0; i < count; i++) cout << "*";
  19. cout << endl;
  20. if (count < num) printStars(count + 1, num);
  21. for (int i = 0; i < count; i++) cout << "*";
  22. cout << endl;
  23. }
Add Comment
Please, Sign In to add comment