Skip to content

Instantly share code, notes, and snippets.

@EBojilova
Created April 26, 2015 21:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EBojilova/b63ca8efc5a25a7a373d to your computer and use it in GitHub Desktop.
Save EBojilova/b63ca8efc5a25a7a373d to your computer and use it in GitHub Desktop.
03.Sunlight
using System;
class Sunlight
{
static void Main(string[] args)
{
int n = int.Parse(Console.ReadLine());
int width=n*3;
Console.WriteLine("{0}*{0}", new string('.', width/2 ));
for (int i = 0; i < n-1; i++)
{
Console.WriteLine("{0}*{1}*{1}*{0}", new string('.', 1 + i), new string('.', (width-(1 + i)*2-3)/2));
}
for (int i = 0; i < (width-3-2*(n-1))/2; i++)
{
Console.WriteLine("{0}{1}{0}", new string('.', n), new string('*', n));
}
Console.WriteLine(new string('*', width));
for (int i = 0; i < (width-3-2*(n-1))/2; i++)
{
Console.WriteLine("{0}{1}{0}", new string('.', n), new string('*', n));
}
for (int i = n-2; i >= 0; i--)
{
Console.WriteLine("{0}*{1}*{1}*{0}", new string('.', 1 + i), new string('.', (width - (1 + i) * 2 - 3) / 2));
}
Console.WriteLine("{0}*{0}", new string('.', width / 2));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment