Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. int main()
  2. {
  3.  
  4. for (int i = 0; i < 5; i++) //*
  5. { //**
  6. for (int j = 0; j < i + 1; j++) //***
  7. cout << "*"; //****
  8. cout << endl; //*****
  9. }
  10. cout << "--------------" << endl;
  11. for (int i = 1; i <= 5; i++) // *
  12. { // **
  13. for (int j = 5; j + 1 > i; j--) // ***
  14. cout << " "; // ****
  15. for (int k = 1; k < i + 1; k++) //*****
  16. cout << "*";
  17. cout << endl;
  18. }
  19. cout << "--------------" << endl;
  20. for (int i = 1; i <= 5; i++) //*****
  21. { // ****
  22. for (int j = 1; j < i + 1; j++) // ***
  23. cout << " "; // **
  24. for (int k = 5; k > i - 1; k--) // *
  25. cout << "*";
  26. cout << endl;
  27. }
  28. cout << "--------------" << endl; //*****
  29. for (int i = 1; i <= 5; i++) //****
  30. { //***
  31. for (int j = 5; j + 1 > i; j--) //**
  32. cout << "*"; //*
  33. cout << endl;
  34. }
  35. cout << "--------------" << endl;
  36.  
  37. for (int i = 1; i < 5; i++) // *
  38. { // ***
  39. for (int j = 5; j > i; j--) // *****
  40. cout << " "; //*******
  41. for (int k = 1; k < (i * 2); k++) // *****
  42. cout << "*"; // ***
  43. cout << endl; // *
  44. }
  45. for (int i = 0; i < 5; i++)
  46. {
  47. for (int j = 0; j < i + 2; j++)
  48. cout << " ";
  49. for (int k = 5; k > (i * 2); k--)
  50. cout << "*";
  51. cout << endl;
  52. }
  53.  
  54. system("pause");
  55. return 0;
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement