Guest User

Untitled

a guest
Dec 16th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include "pch.h"
  2. #include <iostream>
  3.  
  4. int main()
  5. {
  6. int n, no_rows, no_columns;
  7.  
  8. std::cout << "Please Enter the number of Blocks: ";
  9. std::cin >> n;
  10.  
  11.  
  12. no_columns = n;
  13. no_rows = n - 1;
  14.  
  15.  
  16. for (int i = 1; i <= no_rows; i++)
  17. {
  18. for (int j = 0; j < no_columns; j++)
  19. {
  20. std::cout << "*";
  21. }
  22. std::cout << "n";
  23. no_columns = no_columns - 2;
  24.  
  25. for (int k = 0; k < i; k++)
  26. {
  27. std::cout << " ";
  28. }
  29. }
  30. return 0;
  31. }
Add Comment
Please, Sign In to add comment