Guest User

Untitled

a guest
Oct 30th, 2016
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.04 KB | None | 0 0
  1. namespace Axe
  2. {
  3.     using System;
  4.     class Program
  5.     {  
  6.         static int outerdotCount;
  7.         static int innerDotCount;
  8.  
  9.         static void Main(string[] args)
  10.         {
  11.             int n = int.Parse(Console.ReadLine());
  12.             outerdotCount = 2 * n - 2;
  13.             innerDotCount = 3 * n;
  14.             printTop(n);
  15.             printMiddle(n);
  16.             printBottom(n);
  17.         }
  18.  
  19.         private static void printBottom(int n)
  20.         {
  21.             int bettweenStars = outerdotCount;
  22.             for (int i = 0; i <= n / 2 - 1; i++)
  23.             {
  24.                 if (i == n / 2 - 1)
  25.                 {
  26.                     Console.WriteLine("{0}*{1}*{2}",
  27.                         new string('-', innerDotCount),
  28.                         new string('*', bettweenStars),
  29.                         new string('-', outerdotCount));
  30.                     continue;
  31.                 }
  32.                 Console.WriteLine("{0}*{1}*{2}",
  33.               new string('-', innerDotCount),
  34.               new string('-', bettweenStars),
  35.               new string('-', outerdotCount));
  36.                 bettweenStars += 2;
  37.                 innerDotCount--;
  38.                 outerdotCount--;
  39.             }
  40.         }
  41.  
  42.         private static void printMiddle(int n)
  43.         {
  44.             for (int i = 0; i < n / 2; i++)
  45.             {
  46.                 Console.WriteLine("{0}*{1}*{1}",
  47.                     new string('*', innerDotCount),
  48.                     new string('-', outerdotCount));
  49.             }
  50.         }
  51.  
  52.         private static void printTop(int n)
  53.         {
  54.             Console.WriteLine("{0}**{1}", new string('-', innerDotCount),
  55.                                                        new string('-', outerdotCount));
  56.             for (int bettweenCount = 1; bettweenCount < n; bettweenCount++)
  57.             {
  58.                 Console.WriteLine("{0}*{1}*{2}",
  59.                new string('-', innerDotCount),
  60.                new string('-', bettweenCount),
  61.                new string('-', outerdotCount -= 1));
  62.             }
  63.         }
  64.     }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment