Advertisement
Guest User

Untitled

a guest
Nov 19th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.92 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. #define pb(x) push_back((x))
  4. #define MS(x,y) memset((x), (y), sizeof(x))
  5. #define ll long long
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11.     #if LOCAL_DEBUG
  12.         fstream cin("in.txt");
  13.     #endif
  14.  
  15.     ios_base::sync_with_stdio(false);
  16.     cin.tie(0);
  17.     cout.tie(0);
  18.  
  19.     int dolz;
  20.  
  21.     cin>>dolz;
  22.  
  23.     int ctr = 0;
  24.  
  25.     for (int i = dolz/6; i>=1; i--) {
  26.         for (int j = 0; j<i; j++) cout<<" ";
  27.  
  28.         for (int j = 0; j<dolz/6+ctr*2; j++) cout<<"*";
  29.  
  30.         for (int j = 0; j<i*2; j++) cout<<" ";
  31.  
  32.         for (int j = 0; j<dolz/6+ctr*2; j++) cout<<"*";
  33.  
  34.         cout<<endl;
  35.  
  36.         ctr++;
  37.     }
  38.  
  39.     ctr = 0;
  40.  
  41.     for (int i = dolz-(dolz%6); i>=1; i-=2) {
  42.         for (int j = 0; j<ctr; j++) cout<<" ";
  43.  
  44.         for (int j = 0; j<i; j++) cout<<"*";
  45.  
  46.         for (int j = 0; j<ctr; j++) cout<<" ";
  47.  
  48.         cout<<endl;
  49.  
  50.         ctr++;
  51.     }
  52.  
  53.     return 0;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement