Advertisement
Niicksana

Butterfly

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