Advertisement
Niicksana

Java

Dec 3rd, 2017
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.58 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 Java
  8. {
  9.     class Java
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int n = int.Parse(Console.ReadLine());
  14.             int row = (3 * n) + 1;
  15.             int col = (3 * n) + 6;
  16.             int spaces = n;
  17.             int tilde = (2 * n) + 4;
  18.             int spacesLeft = (col - spaces) - 5;
  19.  
  20.             for (int row1 = 1; row1 <= n; row1++)
  21.             {
  22.                 Console.Write(new string(' ', spaces));
  23.                 Console.Write("~");
  24.                 Console.Write(" ");
  25.                 Console.Write("~");
  26.                 Console.Write(" ");
  27.                 Console.Write("~");
  28.                 Console.WriteLine(new string(' ', spacesLeft));
  29.             }
  30.            
  31.             for (int row2 = 1; row2 <= n; row2++)
  32.             {
  33.                 if (row2 == 1 || row2 == n)
  34.                 {
  35.                     Console.WriteLine(new string('=', col - 1));
  36.                 }
  37.  
  38.                 else
  39.                 {
  40.                     if (row2 == (n / 2) + 1)
  41.                     {
  42.                         Console.Write(("|"));
  43.                         Console.Write(new string('~', n));
  44.                         Console.Write("JAVA");
  45.                         Console.Write(new string('~', n));
  46.                         Console.Write(("|"));
  47.                         Console.Write(new string(' ', spaces - 1));
  48.                         Console.WriteLine("|");
  49.                     }
  50.                    
  51.                     else
  52.                     {
  53.                         Console.Write("|");
  54.                         Console.Write(new string('~', tilde));
  55.                         Console.Write("|");
  56.                         Console.Write(new string(' ', spaces - 1));
  57.                         Console.WriteLine("|");
  58.                     }    
  59.                 }
  60.             }
  61.  
  62.             int leftSpaces = 0;
  63.             int rightSpaces = n;
  64.             int at = (2 * n) + 4;
  65.             int equal = (2 * n) + 6;
  66.  
  67.             for (int row3= 1; row3 <= n; row3++)
  68.             {
  69.                 Console.Write(new string(' ', leftSpaces));
  70.                 Console.Write(@"\");
  71.                 Console.Write(new string('@', at));
  72.                 Console.Write("/");
  73.                 Console.WriteLine(new string(' ', rightSpaces));
  74.  
  75.                 leftSpaces++;
  76.                 at -= 2;
  77.                 rightSpaces++;
  78.             }
  79.             Console.WriteLine(new string('=', equal));
  80.         }
  81.     }
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement