Advertisement
Kriss_7777

Vidin_Prep_Exam_Axe

Dec 7th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.92 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Axe
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.  
  14.             int N = int.Parse(Console.ReadLine());
  15.  
  16.             //int width                     = 5 * N;
  17.             int Leading_                    = 3 * N;
  18.             int rows_before_handle          = N / 1;
  19.             int rows_for_handle             = N / 2;
  20.             int rows_after_handle           = N / 2;
  21.             char myString                   = '-';
  22.  
  23.  
  24.  
  25.  
  26.             // till handle cycle ....................................
  27.             for (int i = 0; i < rows_before_handle; i++)
  28.             {
  29.                 Console.WriteLine(new string('-', Leading_) + "*" +
  30.                                   new string('-', i) + "*" +
  31.                                   new string('-', N*5-Leading_-2-i)
  32.                                  );
  33.             }
  34.  
  35.  
  36.  
  37.  
  38.             // handle cycle .........................................
  39.             for (int i = 0; i < rows_for_handle; i++)
  40.             {
  41.                 Console.WriteLine(new string('*', Leading_) + "*" +
  42.                                   new string('-', N-1) + "*" +
  43.                                   new string('-', N - 1));
  44.             }
  45.  
  46.  
  47.  
  48.  
  49.             // after handle cycle ...................................
  50.             for (int i = 0; i < rows_after_handle; i++)
  51.             {
  52.                 if (i == rows_after_handle - 1)
  53.                      myString = '*'; // for last row of shape
  54.                 else
  55.                      myString = '-';
  56.  
  57.  
  58.                 Console.WriteLine(new string('-', Leading_-i) + "*" +
  59.                                   new string(myString, N-1+i*2) + "*" +
  60.                                   new string('-', N-1-i)
  61.                                   );
  62.             }
  63.         }
  64.     }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement