Advertisement
fbinnzhivko

03.Boat

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