SHARE
TWEET

ExamC# 29.12.2012 Task4

g-stoyanov Dec 29th, 2012 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top