SHARE
TWEET

oana

a guest Oct 23rd, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void print(int x) {
  2.     for (int i = 1; i <= x / 2 + 1; ++ i) {
  3.         for (int j = 1; j <= 5 - i; ++ j) {
  4.             cout << "  ";
  5.         }
  6.         for (int j = 1; j <= (i - 1) * 2 + 1; ++ j) {
  7.             cout << x << " ";
  8.         }
  9.         cout << '\n';
  10.     }
  11.     for (int i = x / 2; i >= 1; -- i) {
  12.         for (int j = 1; j <= 5 - i; ++ j) {
  13.             cout << "  ";
  14.         }
  15.         for (int j = 1; j <= (i - 1) * 2 + 1; ++ j) {
  16.             cout << x << " ";
  17.         }
  18.         cout << '\n';
  19.     }
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top