Advertisement
Guest User

Untitled

a guest
Sep 16th, 2017
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 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 ConsoleApp14
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13.  
  14. int N = int.Parse(Console.ReadLine());
  15.  
  16.  
  17. int width = (4 * N) + 1;
  18. int height = (2 * N) + 1;
  19. int dots = 1;
  20. int hash = 2 * N - 1;
  21. int spaces = 1;
  22.  
  23. Console.WriteLine(new string('#', width));
  24.  
  25. for (int row = 1; row <= N; row++)
  26. {
  27. if ((N/2) + 1 == row)
  28. {
  29. Console.WriteLine("{0}{1}{2}(@){2}{1}{0}",
  30. new string('.', dots),
  31. new string('#', hash),
  32. new string(' ', (spaces-3)/2));
  33. dots++;
  34. hash -= 2;
  35. spaces += 2;
  36. }
  37. else
  38. {
  39. Console.WriteLine("{0}{1}{2}{1}{0}",
  40. new string('.', dots),
  41. new string('#', hash),
  42. new string(' ', spaces));
  43. dots++;
  44. hash -= 2;
  45. spaces += 2;
  46. }
  47.  
  48.  
  49.  
  50. }
  51.  
  52. hash = 2 * N - 1;
  53. for (int row = 1; row <= N; row++)
  54. {
  55. Console.WriteLine("{0}{1}{0}",
  56. new string('.', dots),
  57. new string('#', hash));
  58.  
  59. dots++;
  60. hash -= 2;
  61. }
  62. }
  63.  
  64. }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement