Advertisement
Guest User

Untitled

a guest
Apr 11th, 2014
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. using System;
  2.  
  3. class Eggcelent
  4. {
  5. static void Main()
  6. {
  7. int n = int.Parse(Console.ReadLine());
  8.  
  9. int width = 3 * n + 1;
  10. int height = 2 * n;
  11. int start = height - n + 2;
  12. int end = height;
  13. int drawArea = height / 2;
  14.  
  15. for (int i = 1; i <= height; i++)
  16. {
  17. for (int j = 1; j <= width; j++)
  18. {
  19. if((j >= start && j <= end && (i == 1 || i == height)) ||
  20. (j == start || j == end))
  21. Console.Write("*");
  22. else if ((i == drawArea && j % 2 != 0 && j != 1 && j != width) ||
  23. (i == drawArea + 1 && j % 2 == 0 && j != 2 && j != width - 1))
  24. Console.Write("@");
  25. else
  26. Console.Write(".");
  27. }
  28. Console.WriteLine();
  29. if (start > 2 && i < height / 2)
  30. {
  31. start -= 2;
  32. end += 2;
  33. }
  34. else if (i >= height - n / 2)
  35. {
  36. start += 2;
  37. end -= 2;
  38. }
  39. }
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement