Advertisement
Guest User

KaspichaniaBoats

a guest
Apr 2nd, 2014
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. using System;
  2.  
  3. class KaspichaniaBoats
  4. {
  5. static void Main()
  6. {
  7. int N = int.Parse(Console.ReadLine());
  8. int sizeBottom = N;
  9. int width = (N * 2) + 1;
  10. int height = 6 + ((N - 3) / 2) * 3;
  11. int heightSails = (2 * height) / 3;
  12. int heightBottom = height / 3;
  13. int dotOne = N - 2;
  14.  
  15. //first part
  16.  
  17. for (int i = 0; i < 2; i++)
  18. {
  19. Console.Write(new string('.', N - i));
  20. Console.Write(new string('*', width - 2 * (N - i)));
  21. Console.WriteLine(new string('.', N - i));
  22. }
  23. for (int i = 0; i < heightSails - 3; i++)
  24. {
  25. Console.Write(new string('.', dotOne - i));
  26. Console.Write('*');
  27. Console.Write(new string('.', i + 1));
  28. Console.Write('*');
  29. Console.Write(new string('.', i + 1));
  30. Console.Write('*');
  31. Console.Write(new string('.', dotOne - i));
  32. Console.WriteLine();
  33. }
  34. Console.WriteLine(new string('*', width));
  35.  
  36. //second part
  37.  
  38. for (int i = 0; i < heightBottom - 1; i++)
  39. {
  40. Console.Write(new string('.', i + 1));
  41. Console.Write('*');
  42. Console.Write(new string('.', dotOne - i));
  43. Console.Write('*');
  44. Console.Write(new string('.', dotOne - i));
  45. Console.Write('*');
  46. Console.Write(new string('.', i + 1));
  47. Console.WriteLine();
  48. }
  49. Console.Write(new string('.', (width - N) / 2));
  50. Console.Write(new string('*', N));
  51. Console.Write(new string('.', (width - N) / 2));
  52. Console.WriteLine();
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement