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());
- int currentwidth = 1;
- bool middleReached = false;
- for (int i = 0; i < n; i++)
- {
- Console.Write(new string ('.',n - currentwidth));
- Console.Write(new string('*', currentwidth));
- Console.WriteLine(new string('.', n));
- if (currentwidth >= n)
- {
- middleReached = true;
- }
- if (middleReached)
- {
- currentwidth -= 2;
- }
- else
- {
- currentwidth += 2;
- }
- }
- int boatH = (n - 1) / 2;
- int dots = 0;
- for (int i = 0; i < boatH; i++,dots++,n--)
- {
- Console.Write(new string('.',dots));
- Console.Write(new string('*',n*2));
- Console.WriteLine(new string('.',dots));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement