Advertisement
Lamms

03StriptedTower

Aug 30th, 2015
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 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 _03StriptedTowel
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13.  
  14. int n = int.Parse(Console.ReadLine());
  15.  
  16. string a = "#..";
  17. int stringIndex = 0;
  18. int height = (int)Math.Floor(n * 1.5);
  19. char[] state = new char[n];
  20. char[] state2 = new char[n];
  21. char[] state3 = new char[n];
  22.  
  23. int count = 0;
  24.  
  25. for (int i = 0; i < n; i++)
  26. {
  27. stringIndex = i % a.Length;
  28. state[i] = a[stringIndex];
  29. // Console.Write(state[i]);
  30. }
  31. string b = "..#";
  32. for (int i = 0; i < n; i++)
  33. {
  34. stringIndex = i % b.Length;
  35. state2[i] = b[stringIndex];
  36. // Console.Write(state[i]);
  37. }
  38. string c = ".#.";
  39. for (int i = 0; i < n; i++)
  40. {
  41. stringIndex = i % c.Length;
  42. state3[i] = c[stringIndex];
  43. // Console.Write(state[i]);
  44. }
  45.  
  46.  
  47.  
  48. for (int j = 0; j <height ; j++)
  49. {
  50.  
  51. for (int i = 0; i < n; i++)
  52. {
  53. int current = i;
  54.  
  55. if (j%3==0)
  56. {
  57. Console.Write("{0}", state[i]);
  58. }
  59. else if(j%3==1)
  60. {
  61. Console.Write("{0}", state2[i]);
  62. }
  63. else if (j % 3 == 2)
  64. {
  65. Console.Write("{0}", state3[i]);
  66. }
  67.  
  68.  
  69. }
  70. Console.WriteLine();
  71. }
  72.  
  73.  
  74. }
  75. }
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement