fbinnzhivko

05.02 Пеперуда

May 3rd, 2016
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.56 KB | None | 0 0
  1. using System;
  2. class Butterfly
  3. {
  4.     static void Main()
  5.     {
  6.         int n = int.Parse(Console.ReadLine());
  7.  
  8.         // using ?: operator https://msdn.microsoft.com/en-us/library/ty67wk28.aspx
  9.         for (int i = 0; i < n - 2; i++)
  10.         {
  11.             Console.WriteLine("{0}\\ /{0}", new string(i % 2 == 0 ? '*' : '-', n - 2));
  12.         }
  13.         Console.WriteLine(new string(' ', n - 1) + "@");
  14.         for (int i = 0; i < n - 2; i++)
  15.         {
  16.             Console.WriteLine("{0}/ \\{0}", new string(i % 2 == 0 ? '*' : '-', n - 2));
  17.         }
  18.     }
  19. }
Add Comment
Please, Sign In to add comment