Advertisement
syartina_elfarika

Untitled

Nov 21st, 2017
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.96 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. main ()
  4. {
  5.     for (int a=1;a<=4;a++)
  6.     {
  7.         for (int b=4;b>=a;b--)
  8.         {
  9.             cout<<" ";
  10.         }
  11.         for (int c=1;c<=a;c++)
  12.         {
  13.             if (a==1)
  14.             cout<<" ";
  15.             else if (a==2 && c==1)
  16.             cout<<" ";
  17.             else
  18.             cout<<"* ";
  19.         }
  20.         for (int d=a;d<=4;d++)
  21.         {
  22.             if (a==1 && a==2)
  23.             cout<<" ";
  24.             else
  25.             cout<<"  ";
  26.         }
  27.         for (int e=1;e<=a;e++)
  28.         {
  29.             if (a==1)
  30.             cout<<" ";
  31.             else if (a==2 && e==1)
  32.             cout<<"  ";
  33.             else
  34.             cout<<"* ";
  35.         }
  36.            
  37.     cout<<endl;
  38.     }
  39.     for (int a=1;a<=9;a++)
  40.     {
  41.         for (int g=1;g<=a;g++)
  42.         {
  43.             cout<<" ";
  44.         }
  45.         for (int h=9;h>=a;h--)
  46.         {
  47.             cout<<"* ";
  48.         }
  49.         cout<<endl;
  50.     }
  51.  
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement