Advertisement
Guest User

Butterfly

a guest
Mar 13th, 2017
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.12 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.             int width = 2 * n - 1;
  15.             int wing = n - 2;
  16.             for (int i = 1; i <= n- 2; i++)
  17.             {
  18.                 if (i % 2 == 1)
  19.                 {
  20.                     Console.WriteLine("{0}\\ /{0}", new string('*', wing));
  21.                 }
  22.                 else
  23.                 {
  24.                     Console.WriteLine("{0}\\ /{0}", new string('-', wing));
  25.                 }
  26.             }
  27.             Console.WriteLine("{0}@", new string(' ', wing+1));
  28.             for (int i = 1; i <= n - 2; i++)
  29.             {
  30.                 if (i % 2 == 1)
  31.                 {
  32.                     Console.WriteLine("{0}/ \\{0}", new string('*', wing));
  33.                 }
  34.                 else
  35.                 {
  36.                     Console.WriteLine("{0}/ \\{0}", new string('-', wing));
  37.                 }
  38.             }
  39.         }
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement