Advertisement
Guest User

Butterfly

a guest
Aug 14th, 2017
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. public class Program
  6. {
  7.  
  8. public static void Main()
  9. {
  10. int n = int.Parse(Console.ReadLine());
  11.  
  12. string topFirst = new string('*', n - 2) + "\\ /" + new string('*', n - 2);
  13. string topSecond = new string('-', n - 2) + "\\ /" + new string('-', n - 2);
  14.  
  15. string bottomFirst = new string('*', n - 2) + "/ \\" + new string('*', n - 2);
  16. string bottomSecond = new string('-', n - 2) + "/ \\" + new string('-', n - 2);
  17.  
  18. for (int i = 0; i < n-2; i++)
  19. {
  20. if (i % 2 == 0)
  21. {
  22. Console.WriteLine(topFirst);
  23. }
  24. else
  25. {
  26. Console.WriteLine(topSecond);
  27. }
  28. }
  29. Console.WriteLine(new string(' ',n-1) + "@" + new string(' ', n - 1));
  30.  
  31. for (int i = 0; i < n - 2; i++)
  32. {
  33. if (i % 2 == 0)
  34. {
  35. Console.WriteLine(bottomFirst);
  36. }
  37. else
  38. {
  39. Console.WriteLine(bottomSecond);
  40. }
  41. }
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement