Advertisement
DidiMilikina

Untitled

Apr 17th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.31 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 Problem_03___Illuminati_Lock__PB___17_January_2016_
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var n = int.Parse(Console.ReadLine());
  14.             var height = n + 1;
  15.             var width = 3 * n;
  16.          
  17.            
  18.             //first
  19.                 Console.Write(new string('.', n));
  20.                 Console.Write(new string('#', n));
  21.                 Console.WriteLine(new string('.', n));
  22.  
  23.             // second
  24.             var pointsSecond = n - 2;
  25.             Console.Write(new string('.', pointsSecond));
  26.             Console.Write(new string('#', 3));
  27.             Console.Write(new string('.', pointsSecond));
  28.            Console.Write(new string('#', 3));
  29.             Console.WriteLine(new string('.', pointsSecond));
  30.  
  31.             //third
  32.             var pointsBeggining = pointsSecond;
  33.             var pointsMiddle = 2;
  34.            
  35.             for (int i = 0; i < (height - 2) / 2; i++)
  36.             {
  37.                 Console.Write(new string('.', pointsBeggining));
  38.                 Console.Write("##");
  39.                 Console.Write(new string('.', pointsMiddle));
  40.                 Console.Write('#');
  41.                 Console.Write(new string('.', pointsSecond));
  42.                 Console.Write('#');
  43.                 Console.Write(new string('.', pointsMiddle));
  44.                 Console.Write("##");
  45.                 Console.WriteLine(new string('.', pointsBeggining));
  46.                 pointsBeggining -= 2;
  47.                 pointsMiddle += 2;
  48.  
  49.  
  50.                 // fourth
  51.                 Console.Write(new string('.', ));
  52.                 Console.Write("##");
  53.                 Console.Write(new string('.', ));
  54.                 Console.Write('#');
  55.                 Console.Write(new string('.', pointsSecond));
  56.                 Console.Write('#');
  57.                 Console.Write(new string('.',));
  58.                 Console.Write("##");
  59.                 Console.WriteLine(new string('.',));
  60.              
  61.  
  62.                 //last line
  63.                 Console.Write(new string('.', n));
  64.                 Console.Write(new string('*', n));
  65.                 Console.WriteLine(new string('.',n));
  66.             }
  67.         }
  68.     }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement