Advertisement
Guest User

aesdgf

a guest
Mar 26th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.69 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 Q5
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var n = int.Parse(Console.ReadLine());
  14.             var shirina = 2 * n + 1;
  15.             Console.WriteLine(new string('*', shirina));
  16.             Console.WriteLine("{0}{1}{2}", magicString(".*",1), new string(' ', shirina - 4), magicString("*.",1));
  17.             var leviTochki = 2;
  18.             var kliomba = 2 * n - 5;
  19.  
  20.             for (int i = 0; i < n-2; i++)
  21.             {
  22.                 Console.WriteLine("{0}*{1}*{2}", new string('.', leviTochki), new string('@', kliomba), new string('.', leviTochki));
  23.                 leviTochki++;
  24.                 kliomba-=2;
  25.             }
  26.             Console.WriteLine("{0}*{0}", new string('.',(shirina-1)/2));
  27.  
  28.             var leviTochki2 = (shirina - 3) / 2;
  29.             var desniTochki2 = leviTochki2;
  30.             var space = 0;
  31.  
  32.             for (int i = 0; i < n-2; i++)
  33.             {
  34.                 Console.WriteLine("{0}*{1}@{1}*{0}", new string('.',leviTochki2), new string(' ', space));
  35.                 leviTochki2--;
  36.                 space++;
  37.             }
  38.             Console.WriteLine("."+"*" + "{0}" + "*" + ".", new string('@', shirina - 4));
  39.             Console.WriteLine("{0}",new string('*', shirina));
  40.         }
  41.  
  42.         public static string magicString(string text, int repeatCount)
  43.         {
  44.             string outputText = "";
  45.  
  46.             for (int i = 0; i < repeatCount; i++)
  47.             {
  48.                 outputText = outputText + text;
  49.             }
  50.             return outputText;
  51.         }
  52.     }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement