Advertisement
svetoslavhl

Telerik_Logo

Mar 4th, 2014
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. using System;
  2. class ExcelColumns
  3. {
  4. static void Main()
  5. {
  6. int N = int.Parse(Console.ReadLine());
  7.  
  8. int firstRight = N / 2 + 1;
  9. int firstLeft = N / 2 + 1;
  10. int secondRight = N + N + N / 2 + N / 2 - 1 - N / 2;
  11. int secondLeft = N + N + N / 2 + N / 2 - 1 - N / 2;
  12.  
  13. //FIRST PART
  14.  
  15. for (int f = 1; f <= N + N + N - 2; f++)
  16. {
  17.  
  18.  
  19.  
  20.  
  21. for (int i = 1; i <= (N + N + N / 2 + N / 2 - 1); i++)
  22. {
  23.  
  24.  
  25. if (i == firstLeft || i == firstRight || i == secondLeft || i == secondRight)
  26. {
  27.  
  28. Console.Write("*");
  29.  
  30. }
  31. else
  32. {
  33.  
  34.  
  35. Console.Write(".");
  36.  
  37. }
  38.  
  39.  
  40. }
  41.  
  42. //RIGHT PART
  43. /*for (int i = 1; i <= (N / 2 + N) - 1; i++)
  44. {
  45.  
  46.  
  47. if (i == secondLeft || i == secondRight)
  48. {
  49.  
  50. Console.Write("*");
  51.  
  52. }
  53. else
  54. {
  55.  
  56.  
  57. Console.Write(".");
  58.  
  59. }
  60.  
  61.  
  62. }*/
  63.  
  64. if (f < N + N - 1)
  65. {
  66. firstLeft--;
  67. firstRight++;
  68.  
  69. secondLeft--;
  70. secondRight++;
  71. Console.WriteLine();
  72. }
  73.  
  74. if (f >= N + N - 1)
  75. {
  76.  
  77. firstRight--;
  78.  
  79. secondLeft++;
  80.  
  81. Console.WriteLine();
  82. }
  83.  
  84.  
  85. }
  86. }
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement