Advertisement
Niicksana

Fox

Dec 10th, 2017
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.84 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. namespace _5.Fox
  8. {
  9.     class Fox
  10.     {
  11.         // Exam - 20 November 2016 - Morning
  12.         static void Main(string[] args)
  13.         {
  14.             int n = int.Parse(Console.ReadLine());
  15.  
  16.             int firstStars = 1;
  17.             int centralDashes = (2 * n + 3) - 4;
  18.             for (int row = 1; row <= n; row++)
  19.             {
  20.                 Console.Write(new string('*', firstStars));
  21.                 Console.Write(@"\");
  22.                 Console.Write(new string('-', centralDashes));
  23.                 Console.Write("/");
  24.                 Console.WriteLine(new string('*', firstStars));
  25.                 firstStars++;
  26.                 centralDashes -= 2;
  27.             }
  28.  
  29.             int stars = n / 2;
  30.             int centralStars = (2 * n + 3) - (2 * (n / 2) + 4);
  31.             for (int row = 1; row <= n / 3; row++)
  32.             {
  33.                 Console.Write("|");
  34.                 Console.Write(new string('*', stars));
  35.                 Console.Write(@"\");
  36.                 Console.Write(new string('*', centralStars));
  37.                 Console.Write("/");
  38.                 Console.Write(new string('*', stars));
  39.                 Console.WriteLine("|");
  40.                 stars++;
  41.                 centralStars -= 2;
  42.             }
  43.  
  44.             int firstDashes = 1;
  45.             int centStars = (2 * n + 3) - 4;
  46.             for (int row = 1; row <= n; row++)
  47.             {
  48.                 Console.Write(new string('-', firstDashes));
  49.                 Console.Write(@"\");
  50.                 Console.Write(new string('*', centStars));
  51.                 Console.Write("/");
  52.                 Console.WriteLine(new string('-', firstDashes));
  53.                 firstDashes++;
  54.                 centStars -= 2;
  55.             }
  56.         }
  57.     }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement