Advertisement
iliqnvidenov

Untitled

Mar 30th, 2015
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.18 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. class BitsInverter
  6. {
  7.     static void Main()
  8.     {
  9.         int n = int.Parse(Console.ReadLine());
  10.         int dots = n / 2;
  11.         int ands = n - dots;
  12.         int middleDots = n;
  13.         Console.Write(new string('.',dots));
  14.         Console.Write(new string('&', ands));
  15.         Console.Write(new string('.', middleDots));
  16.         Console.Write(new string('&', ands));
  17.         Console.WriteLine(new string('.', dots));
  18.         int length = (n / 2) - 1;
  19.         int asteriscs = n / 2;
  20.         dots--;
  21.         for (int i = 0; i < length; i++,asteriscs++,dots--)
  22.         {
  23.             Console.Write(new string('.', dots));
  24.             Console.Write('&');
  25.             Console.Write(new string('*', asteriscs));
  26.             Console.Write('&');
  27.             Console.Write(new string('.', middleDots));
  28.             Console.Write('&');
  29.             Console.Write(new string('*', asteriscs));
  30.             Console.Write('&');
  31.             Console.WriteLine(new string('.', dots));
  32.         }
  33.         Console.Write(new string('.', dots));
  34.         Console.Write('&');
  35.         Console.Write(new string('*', asteriscs));
  36.         Console.Write('&');
  37.         Console.Write(new string('=', middleDots));
  38.         Console.Write('&');
  39.         Console.Write(new string('*', asteriscs));
  40.         Console.Write('&');
  41.         Console.WriteLine(new string('.', dots));
  42.         dots++;
  43.         asteriscs--;
  44.         for (int i = 0; i < length; i++, asteriscs--, dots++)
  45.         {
  46.             Console.Write(new string('.', dots));
  47.             Console.Write('&');
  48.             Console.Write(new string('*', asteriscs));
  49.             Console.Write('&');
  50.             Console.Write(new string('.', middleDots));
  51.             Console.Write('&');
  52.             Console.Write(new string('*', asteriscs));
  53.             Console.Write('&');
  54.             Console.WriteLine(new string('.', dots));
  55.         }
  56.         Console.Write(new string('.', dots));
  57.         Console.Write(new string('&', ands));
  58.         Console.Write(new string('.', middleDots));
  59.         Console.Write(new string('&', ands));
  60.         Console.WriteLine(new string('.', dots));
  61.     }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement