EmoRz

Untitled

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