Advertisement
4valeri

RockLq

Feb 7th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.47 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.  
  8. class RockLq
  9. {
  10.     static void Main(string[] args)
  11.     {
  12.         int n = int.Parse(Console.ReadLine());
  13.  
  14.         int width = 3 * n;
  15.         int height = 2 * n;
  16.  
  17.         Console.WriteLine("{0}{1}{0}",
  18.             new string('.', n),
  19.             new string('*', n),
  20.             new string('.', n));
  21.  
  22.         int secondPart = (n-1) / 2;
  23.         int secondPart2 = n - 2;
  24.         int secondPart3 = n + 2;
  25.  
  26.         for (int i = 0; i <= secondPart - 1; i++)
  27.         {
  28.  
  29.             Console.WriteLine("{0}*{1}*{0}",
  30.                 new string('.', secondPart2),
  31.                 new string('.', secondPart3),
  32.                 new string ('.', secondPart2));
  33.  
  34.             secondPart2-=2;
  35.             secondPart3 += 4;
  36.  
  37.         }
  38.  
  39.         int thirdPart = n - 2;
  40.         int thirdPart2 = n;
  41.  
  42.         Console.WriteLine("*{0}*{1}*{0}*",
  43.             new string('.', thirdPart),
  44.             new string('.', thirdPart2),
  45.             new string('.', thirdPart));
  46.  
  47.         int fourthPart = (n - 3) / 2; // много важен ред..РЕШАВАЩ
  48.         int fourthPart2 = n - 4;
  49.         int fourthPart3 = n - (n - 1);
  50.         int fourthPart4 = n;
  51.  
  52.        
  53.         for (int i = 0; i < fourthPart ; i++)
  54.         {
  55.             Console.WriteLine("*{0}*{1}*{2}*{1}*{0}*",
  56.                 new string('.', fourthPart2),
  57.                 new string('.', fourthPart3),
  58.                 new string('.', fourthPart4),
  59.                 new string('.', fourthPart3),
  60.                 new string('.', fourthPart2));
  61.             fourthPart2 -= 2;
  62.             fourthPart3 += 2;
  63.         }
  64.         int fifthPart = n - 1;
  65.             int fifthPart2 = n;
  66.  
  67.             Console.WriteLine("{0}*{1}*{0}",
  68.                 new string('.', fifthPart),
  69.                 new string('.', fifthPart2),
  70.                 new string('.', fifthPart));
  71.  
  72.         int sixthPart = n - 2;
  73.         int sixthPart2 = n - 2;
  74.         int sixthPart3 = n + 2;
  75.  
  76.  
  77.  
  78.         for (int i = 0; i < sixthPart; i++)
  79.         {
  80.             Console.WriteLine("{0}*{1}*{0}",
  81.                 new string('.', sixthPart2),
  82.                 new string('.', sixthPart3),
  83.                 new string('.', sixthPart2));
  84.  
  85.             sixthPart2 -= 1;
  86.             sixthPart3 += 2;
  87.  
  88.         }
  89.  
  90.         int lastPart = n * 3;
  91.  
  92.         Console.WriteLine("{0}",
  93.             new string ('*', lastPart));
  94.  
  95.  
  96.     }
  97. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement