Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Diamond
- {
- class Diamond
- {
- static void Main(string[] args)
- {
- var n = int.Parse(Console.ReadLine());
- if (n >= 4 && n <= 32)
- {
- Console.WriteLine(new string('.', n) + new string('*', n*3) + new string('.', n));
- for (int i = n-1; i > 0; i--)
- {
- Console.WriteLine(new string('.', i) + "*" + new string('.', n*3+(n-1-i)*2) + "*" + new string('.', i));
- }
- Console.WriteLine(new string('*', n) + new string('*', n*3) + new string('*', n));
- for (int i = 1; i <= n*2; i++)
- {
- Console.WriteLine(new string('.', i) + "*" + new string('.', n * 3 - 2 + (n-i) * 2) + "*" + new string('.', i));
- }
- Console.WriteLine(new string('.', ((n*2)+1)) + new string('*', n-2) + new string('.', ((n*2+1))));
- }
- else
- {
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement