Advertisement
g-stoyanov

ExamC# 29.12.2012 Task4

Dec 29th, 2012
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.18 KB | None | 0 0
  1. using System;
  2.  
  3. class Task4
  4. {
  5.     static void Main()
  6.     {
  7.         int input = int.Parse(Console.ReadLine());
  8.         int tempDot = (input - 3) / 2;
  9.         for (int dot = tempDot; dot >= -tempDot; dot --)
  10.         {
  11.             if (dot >= 0)
  12.             {
  13.                 Console.WriteLine(new string('.', tempDot - dot) + new string('\\', 1) + new string('.', dot) + new string('|', 1) + new string('.', dot) + new string('/', 1) + new string('.', tempDot - dot));
  14.             }
  15.             else
  16.             {
  17.                 Console.WriteLine(new string('.', tempDot - Math.Abs(dot)) + new string('/', 1) + new string('.', Math.Abs(dot)) + new string('|', 1) + new string('.', Math.Abs(dot)) + new string('\\', 1) + new string('.', tempDot - Math.Abs(dot)));
  18.             }
  19.             if (dot == 0)
  20.             {
  21.                 Console.WriteLine(new string('-', (input - 1) / 2) + "*" + new string('-', (input - 1) / 2));
  22.                 Console.WriteLine(new string('.', tempDot - Math.Abs(dot)) + new string('/', 1) + new string('.', Math.Abs(dot)) + new string('|', 1) + new string('.', Math.Abs(dot)) + new string('\\', 1) + new string('.', tempDot - Math.Abs(dot)));
  23.             }
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement