Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class KaspichaniaBoats
- {
- static void Main()
- {
- int N = int.Parse(Console.ReadLine());
- int width = (N * 2) + 1;
- int height = 6 + ((N - 3) / 2) * 3;
- int sailHeight = height * 2 / 3;
- int bottomHeight = height * 1 / 3;
- // print top(sail) part
- for (int i = 0; i < sailHeight; i++)
- {
- if (i == sailHeight - 1)
- {
- Console.Write(new string('*', width));
- }
- else
- {
- int starPos = i - 1;
- for (int j = N - 1; j >= 0; j--)
- {
- if (starPos == j) Console.Write('*');
- else Console.Write('.');
- }
- Console.Write('*');
- for (int j = 0; j < N; j++)
- {
- if (starPos == j) Console.Write('*');
- else Console.Write('.');
- }
- }
- Console.WriteLine();
- }
- // print bottom(base) part
- for (int i = 0; i < bottomHeight; i++)
- {
- if (i == bottomHeight - 1)
- {
- int dots = (width - N) / 2;
- Console.Write(new string('.', dots) +
- new string('*', N) + new string('.', dots));
- }
- else
- {
- int starPos = i + 1;
- for (int j = 0; j < N; j++)
- {
- if (starPos == j) Console.Write('*');
- else Console.Write('.');
- }
- Console.Write('*');
- for (int j = N - 1; j >= 0; j--)
- {
- if (starPos == j) Console.Write('*');
- else Console.Write('.');
- }
- }
- Console.WriteLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement