Advertisement
Guest User

Stop

a guest
May 22nd, 2016
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 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 Stop
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int n = int.Parse(Console.ReadLine());
  14. int counter = 0;
  15. //first row
  16. Console.WriteLine("{0}{1}{0}", new string('.',n+1),new string('_',n*2+1));
  17.  
  18. //middle
  19. for (int i = 0; i < n; i++)
  20. {
  21. for (int y = n; y > i; y--)
  22. {
  23. Console.Write(".");
  24. }
  25. counter++;
  26. Console.Write("//{0}\\\\",new string('_',n*2+counter-2));
  27. counter++;
  28. for (int y = n; y > i; y--)
  29. {
  30. Console.Write(".");
  31. }
  32. Console.WriteLine();
  33. }
  34.  
  35. //stop sign
  36. Console.WriteLine("//{0}STOP!{0}\\\\",new string('_',n * 2-3));
  37.  
  38. //bottom part
  39. for (int i = 0; i < n; i++)
  40. {
  41. for (int y = 0; y < i; y++)
  42. {
  43. Console.Write(".");
  44. }
  45. counter--;
  46. Console.Write("\\\\{0}//", new string('_', n * 2 + counter ));
  47. counter--;
  48. for (int y = 0; y < i; y++)
  49. {
  50. Console.Write(".");
  51. }
  52. Console.WriteLine();
  53. }
  54.  
  55. }
  56. }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement