Advertisement
ad2bg

Untitled

Dec 3rd, 2017
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.25 KB | None | 0 0
  1. namespace Java
  2. {
  3.     using System;
  4.  
  5.     static class Java
  6.     {
  7.         static void Main()
  8.         {
  9.             int n = int.Parse(Console.ReadLine());
  10.  
  11.             for (int i = 0; i < n; i++) { Console.WriteLine(' '.Times(n) + "~ ".Times(3)); }
  12.             Console.WriteLine('='.Times(3 * n + 5));
  13.             for (int i = 1; i <= n - 2; i++)
  14.             {
  15.                 if (i == Math.Ceiling((double)(n - 1) / 2))
  16.                 { Console.WriteLine('|' + '~'.Times(n) + "JAVA" + '~'.Times(n) + '|' + ' '.Times(n - 1) + '|'); }
  17.                 else { Console.WriteLine('|' + '~'.Times(2 * n + 4) + '|' + ' '.Times(n - 1) + '|'); }
  18.             }
  19.             Console.WriteLine('='.Times(3 * n + 5));
  20.             for (int i = 0; i < n; i++)
  21.             {
  22.                 string line = ' '.Times(i) + "\\" + '@'.Times(2 * n + 4 - 2 * i) + '/';
  23.                 Console.WriteLine(line);
  24.             }
  25.             Console.WriteLine('='.Times(2 * n + 6));
  26.         }
  27.  
  28.         static string Times(this char c, int x) => new string(c, x);
  29.  
  30.         static string Times(this string s, int x)
  31.         {
  32.             string newString = string.Empty;
  33.             for (int i = 0; i < x; i++) { newString += s; }
  34.             return newString;
  35.         }
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement