Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace _4.KaspichaniaBoats
- {
- using System;
- public class KaspichaniaBoats
- {
- public static void Main(string[] args)
- {
- checked
- {
- int num = int.Parse(Console.ReadLine());
- int width = (2 * num) + 1;
- int height = 6 + (((num - 3) / 2) * 3);
- for (int row = 0; row < height; row++)
- {
- for (int col = 0; col < width; col++)
- {
- if (row == num || col == num || (row == height - 1 && col >= num - (num / 2) && col <= num + (num / 2)))
- {
- Console.Write("*");
- }
- else if (col == row - num || col == (width - 1) - (row - num) || col == num - row || col == num + row)
- {
- Console.Write("*");
- }
- else
- {
- Console.Write(".");
- }
- }
- Console.WriteLine();
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement