SHARE
TWEET

Buttefly

krasi1105 Aug 15th, 2017 (edited) 97 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Linq;
  3.  
  4. public class Program
  5. {
  6.     public static void Main()
  7.     {
  8.         int n = int.Parse(Console.ReadLine()) - 2;
  9.         var wings = Enumerable.Range(0, n)
  10.         .Select(a => string.Format(@"{0}\ /{0}", new string(a % 2 == 0 ? '*' : '-', n)));
  11.         var reversed = wings.Select(a => new string(a.Reverse().ToArray()));
  12.         var butterfly = wings.Concat(new[] { string.Format("{0}@{0}", new string(' ', n + 1)) }).Concat(reversed);
  13.         Console.WriteLine(string.Join(Environment.NewLine, butterfly));
  14.     }
  15. }
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