iliya87

03.DrawRockLq

Mar 25th, 2015
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.90 KB | None | 0 0
  1. using System;
  2.  
  3. class RockLq
  4. {
  5.     static void Main(string[] args)
  6.     {
  7.        
  8.  
  9.         int n = int.Parse(Console.ReadLine());
  10.  
  11.         Console.WriteLine("{0}{1}{0}",new string('.',n), new string('*',n));
  12.         for (int i = 0; i < n/2; i++)
  13.         {
  14.             Console.WriteLine("{0}*{1}*{0}", new string('.',n-2-i*2) , new string ('.',n+2+i*4));
  15.         }
  16.        
  17.  
  18.         Console.WriteLine("*{0}*{1}*{0}*", new string('.', n - 2), new string('.', n));
  19.  
  20.         for (int i = 0; i < n / 2 - 1; i++)
  21.         {
  22.             Console.WriteLine("*{0}*{1}*{2}*{1}*{0}*", new string('.', n - 4 - 2 * i), new string('.', 1 + 2 * i), new string('.', n));
  23.         }
  24.         for (int i = 0; i < n - 1; i++)
  25.         {
  26.             Console.WriteLine("{0}*{1}*{0}", new string('.', n - 1 - i), new string('.', n + 2 * i));
  27.         }
  28.         Console.WriteLine("{0}", new string('*', 3 * n));
  29.  
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment