Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Boat
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- char dot = '.';
- char star = '*';
- int firstDots = n - 1;
- int firstStars = 1;
- for (int i = 0; i < n/2; i++)
- {
- Console.WriteLine("{0}{1}{2}",
- new string (dot,firstDots),
- new string (star,firstStars),
- new string (dot,n));
- firstDots -= 2;
- firstStars += 2;
- }
- Console.WriteLine("{0}{1}",new string (star,n),new string (dot,n));
- for (int i = 0; i < n / 2; i++)
- {
- firstDots += 2;
- firstStars -= 2;
- Console.WriteLine("{0}{1}{2}",
- new string(dot, firstDots),
- new string(star, firstStars),
- new string(dot, n));
- }
- int lastdots = 0;
- int laststars = n * 2;
- for (int i = 0; i < n/2; i++)
- {
- Console.WriteLine("{0}{1}{0}", new string(dot, lastdots),new string(star, laststars));
- laststars -= 2;
- lastdots++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement