bacco

Java

Feb 12th, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.81 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Калинка
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int n = int.Parse(Console.ReadLine());
  10.  
  11.             int width = 3 * n + 6;
  12.             int heght = 3 * n + 1;
  13.  
  14.  
  15.             int spacesCount = width / 3 -2;
  16.             string spaces = new string(' ', spacesCount);
  17.  
  18.  
  19.             for (int i = 0; i < n; i++)
  20.             {
  21.                 Console.WriteLine($"{spaces}~ ~ ~");
  22.             }
  23.  
  24.             int equalsSignCount = width - 1 ;
  25.             string equalsSign = new string('=', equalsSignCount);
  26.  
  27.             Console.WriteLine($"{equalsSign}");
  28.  
  29.             for (int i = 0; i < n -2; i++)
  30.             {
  31.                if (i == n / 2 - 1)
  32.                 {
  33.                     Console.Write("|");
  34.                     for (int j = 0; j < n; j++)
  35.                     {
  36.                         Console.Write("~");
  37.                     }
  38.  
  39.                     Console.Write("JAVA");
  40.  
  41.                     for (int j = 0; j < n; j++)
  42.                     {
  43.                         Console.Write("~");
  44.                     }
  45.                     Console.Write("|");
  46.                     for (int s = 0; s < n - 1; s++)
  47.                     {
  48.                         Console.Write(" ");
  49.                     }
  50.                     Console.Write("|");
  51.  
  52.                     Console.WriteLine();
  53.                 }
  54.                 else
  55.                 {
  56.                     Console.Write("|");
  57.  
  58.                     for (int j = 0; j < n * 2 + 4; j++)
  59.                     {
  60.                         Console.Write("~");
  61.                     }
  62.                     Console.Write("|");
  63.  
  64.                     for (int s = 0; s < n - 1; s++)
  65.                     {
  66.                         Console.Write(" ");
  67.                     }
  68.                     Console.Write("|");
  69.  
  70.                     Console.WriteLine();
  71.                 }
  72.             }
  73.  
  74.  
  75.             Console.WriteLine($"{equalsSign}");
  76.  
  77.  
  78.             for (int i = 1; i <= n; i++)
  79.             {
  80.                 for (int s = 0 - i; s < -1 ; s++)
  81.                 {
  82.                     Console.Write(" ");
  83.                 }
  84.                 Console.Write("\\");
  85.  
  86.                 for (int r = 0 + i; r < n; r++)
  87.                 {
  88.                     Console.Write("@");
  89.                 }
  90.  
  91.                 Console.Write ("@@@@@@");
  92.  
  93.  
  94.                 for (int r = 0 + i; r < n; r++)
  95.                 {
  96.                     Console.Write("@");
  97.                 }
  98.                 Console.Write("/");
  99.  
  100.                 Console.WriteLine();
  101.             }
  102.  
  103.             int equalsSignCountLast = equalsSignCount - n + 1;
  104.             string equalsSignLast = new string('=', equalsSignCountLast);
  105.            
  106.  
  107.                 Console.WriteLine($"{equalsSignLast}");
  108.         }
  109.     }
  110. }
Advertisement
Add Comment
Please, Sign In to add comment