Guest User

C++ Choinka

a guest
Oct 13th, 2014
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <conio.h>
  4. using namespace std;
  5.  
  6. int main()
  7.  
  8. {
  9. do
  10. {
  11. int n;
  12. cout << "Ile wierszy? ";
  13. cin >> n;
  14.  
  15.  
  16. for (int i = 0; i < n ; i++)
  17. {
  18.  
  19. for (int j = 0; j < 2 * i - j; j++)
  20. cout << ' ';
  21.  
  22. for (int j = 0; j < 2 * n - 2 * i - 1 ; j++)
  23. cout << '*';
  24. cout << endl;
  25. }
  26. }
  27. while (getch());
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment