Advertisement
AlexTasev

JAVA Cup

Apr 26th, 2018
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.58 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _5_JavaCup
  4. {
  5.     class Program
  6.     {
  7.         static void Main()
  8.         {
  9.             int n = int.Parse(Console.ReadLine());
  10.  
  11.             int width = 3 * n + 6;
  12.  
  13.             // Steam
  14.  
  15.             for (int i = 0; i < n; i++)
  16.             {
  17.                 Console.WriteLine(new string(' ', n) + "~ ~ ~");
  18.             }
  19.  
  20.             // Top of The Cup
  21.  
  22.             Console.WriteLine(new string('=', width - 1));
  23.  
  24.             int tilda = width - (n + 2);
  25.  
  26.             // Part with JAVA Logo
  27.  
  28.             for (int i = 1; i <= n - 2; i++)
  29.             {
  30.                 if (i == n / 2)
  31.                 {
  32.                     tilda = tilda / 2 - 2;
  33.                     Console.WriteLine("|" + new string('~', tilda) + "JAVA" + new string('~', tilda) + "|" + new string(' ', n - 1) + "|");
  34.                 }
  35.                 else
  36.                 {
  37.                     tilda = width - (n + 2);
  38.                     Console.WriteLine("|" + new string('~', tilda) + "|" + new string(' ', n - 1) + "|");
  39.                 }
  40.             }
  41.  
  42.             Console.WriteLine(new string('=', width - 1));
  43.  
  44.             // Botoom Part
  45.  
  46.             int ampersant = tilda;
  47.             int spaces = 0;
  48.  
  49.             for (int i = 0; i < n; i++)
  50.             {
  51.                 Console.WriteLine(new string(' ', spaces) + "\\" + new string('@', ampersant) + "/" + new string(' ', spaces));
  52.                 spaces++;
  53.                 ampersant -= 2;
  54.             }
  55.  
  56.             int equal = tilda + 2;
  57.             Console.WriteLine(new string('=', equal));
  58.         }
  59.     }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement