Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int a,b,c,i,x,y;
- a=1;
- b=1;
- i=1;
- y=1;
- while (i<=8) {
- c=a;
- y=y+1;
- while (b<=8) {
- cout << " " << c;
- c=(c*2)+b;
- b=b+1;
- }
- for (x=i; x>=1; x--) {
- cout << " * ";
- }
- while (b>=y) {
- b=b-1;
- c=(c-b)/2;
- cout << " " << c;
- }
- a=a+i;
- b=i+1;
- cout << endl;
- i=i+1;
- }
- while (i>=2) {
- i=i-1;
- b=i-1;
- a=a-i;
- c=a;
- y=y-1;
- while (b<=7) {
- cout << " " << c;
- b=b+1;
- c=c*2+b;
- }
- for (x=i; x>=1; x--) {
- cout << " * ";
- }
- while (b>=y) {
- b=b-1;
- c=(c-b)/2;
- cout << " " << c;
- }
- cout << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement