SHARE
TWEET

Untitled

a guest Nov 16th, 2019 247 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.  int a,b,c,i,x,y;
  6.  a=1;
  7.  b=1;
  8.  i=1;
  9.  y=1;
  10.  while (i<=8) {
  11.   c=a;
  12.   y=y+1;
  13.   while (b<=8) {
  14.    cout << " " << c;
  15.    c=(c*2)+b;
  16.    b=b+1;
  17.   }
  18.   for (x=i; x>=1; x--) {
  19.    cout << "  *   ";
  20.   }
  21.   while (b>=y) {
  22.    b=b-1;
  23.    c=(c-b)/2;
  24.    cout << " " << c;
  25.   }
  26.   a=a+i;
  27.   b=i+1;
  28.   cout << endl;
  29.   i=i+1;
  30.  }
  31.  while (i>=2) {
  32.   i=i-1;
  33.   b=i-1;
  34.   a=a-i;
  35.   c=a;
  36.   y=y-1;
  37.   while (b<=7) {
  38.    cout << " " << c;
  39.    b=b+1;
  40.    c=c*2+b;
  41.   }
  42.   for (x=i; x>=1; x--) {
  43.    cout << "  *   ";
  44.   }
  45.   while (b>=y) {
  46.    b=b-1;
  47.    c=(c-b)/2;
  48.    cout << " " << c;
  49.   }
  50.   cout << endl;
  51.  }
  52.  return 0;
  53. }
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
 
Top