Advertisement
Sim0o0na

05. Sublime Logo

Apr 30th, 2018
561
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.98 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 SublimeLogo
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var n = int.Parse(Console.ReadLine());
  14.  
  15.             var space = ' ';
  16.             var star = '*';
  17.  
  18.             var spacescount = 2 * n - 2;
  19.             var starscount = 2;
  20.  
  21.             //top
  22.  
  23.             for (int row = 0; row < n; row++)
  24.             {
  25.                     Console.Write(new string(space, spacescount));
  26.                     Console.Write(new string(star, starscount));
  27.                     spacescount -= 2;
  28.                     starscount += 2;
  29.                     Console.WriteLine();
  30.             }
  31.  
  32.             //middletop1
  33.  
  34.             spacescount = 2;
  35.             starscount = 2 * n - 2;
  36.  
  37.             for (int row = 0; row < 2; row++)
  38.             {
  39.                 Console.Write(new string(star, starscount));
  40.                 Console.Write(new string(space, spacescount));
  41.                 spacescount += 2;
  42.                 starscount -= 2;
  43.                 Console.WriteLine();
  44.             }
  45.  
  46.             //middletop2
  47.  
  48.             spacescount = 2;
  49.             starscount = 2 * n - 2;
  50.  
  51.             for (int row = 0; row < 2; row++)
  52.             {
  53.                 Console.Write(new string(star, starscount));
  54.                 Console.Write(new string(space, spacescount));
  55.                 if (spacescount > 0 && starscount > 0)
  56.                 {
  57.                     spacescount -= 2;
  58.                     starscount += 2;
  59.                 }
  60.                 Console.WriteLine();
  61.             }
  62.  
  63.  
  64.  
  65.             //middlebottom1
  66.  
  67.             spacescount = 2;
  68.             starscount = 2 * n - 2;
  69.  
  70.             for (int row = 0; row < 2; row++)
  71.             {
  72.                 Console.Write(new string(space, spacescount));
  73.                 Console.Write(new string(star, starscount));
  74.                 spacescount += 2;
  75.                 starscount -= 2;
  76.                 Console.WriteLine();
  77.             }
  78.  
  79.             //middlebottom2
  80.  
  81.             spacescount = 2;
  82.             starscount = 2 * n - 2;
  83.  
  84.             for (int row = 0; row < 2; row++)
  85.             {
  86.                 Console.Write(new string(space, spacescount));
  87.                 Console.Write(new string(star, starscount));
  88.                 if (spacescount > 0 && starscount > 0)
  89.                 {
  90.                     spacescount -= 2;
  91.                     starscount += 2;
  92.                 }
  93.                 Console.WriteLine();
  94.             }
  95.  
  96.  
  97.  
  98.             //bottom
  99.  
  100.             spacescount = 2;
  101.             starscount = 2 * n - 2;
  102.  
  103.             for (int row = 0; row < n; row++)
  104.             {
  105.                 Console.Write(new string(star, starscount));
  106.                 Console.Write(new string(space, spacescount));
  107.                 spacescount += 2;
  108.                 starscount -= 2;
  109.                 Console.WriteLine();
  110.             }
  111.  
  112.         }
  113.     }
  114. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement