Advertisement
IvanBorisovG

SoftuniLogo

Nov 1st, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.62 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 SoftUniLogo
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int size = int.Parse(Console.ReadLine());
  14.             int height = 4 * size - 2;
  15.             int width = 12 * size - 5;
  16.  
  17.             int dots = width / 2;
  18.             int hashtag = 1;
  19.             for (int i = 1; i <= height / 2; i++)
  20.             {
  21.                 Console.WriteLine("{0}{1}{0}", new string('.', dots), new string('#', hashtag));
  22.                 dots -= 3;
  23.                 hashtag += 6;
  24.             }
  25.             Console.WriteLine(new string('#', width));
  26.             int leftDots = 2;
  27.             int rightDots = 3;
  28.             int btwHashtags = width - 6;
  29.             for (int i = 1; i <= height / 4 - 1; i++)
  30.             {              
  31.                 Console.WriteLine("|{0}{1}{2}", new string('.', leftDots), new string('#', btwHashtags), new string('.', rightDots));              
  32.                 leftDots += 3;
  33.                 btwHashtags -= 6;
  34.                 rightDots += 3;
  35.             }
  36.             for (int i = 1; i <= size; i++)
  37.             {
  38.                 if (i == size)
  39.                 {
  40.                     Console.WriteLine("@{0}{1}{2}", new string('.', width / 4 - 2), new string('#', width / 2 + 4), new string('.', width / 4 - 1));
  41.                     break;
  42.                 }
  43.                 Console.WriteLine("|{0}{1}{2}",new string('.',width / 4 - 2),new string('#',width / 2 + 4),new string('.',width / 4 - 1));
  44.             }
  45.         }
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement