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 _09PerfectDimond
- {
- class Program
- {
- static void Main (string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- string ss = ('%' + new string (' ', n * 2 - 2) + '%');
- Console.WriteLine (new string ('%', 2 * n));
- if(n >2)
- {
- for(var i = 0; i <= n-1;i++)
- {
- if(i == n/2)
- {
- ss = ("%" + new string(' ',(n-2)) + "**" + new string(' ', n-2) + "%");
- Console.WriteLine(ss);
- }
- else if(i != n/2)
- {
- ss = ('%' + new string (' ', n * 2 - 2) + '%');
- Console.WriteLine (ss);
- }
- }
- }
- else
- {
- Console.WriteLine ("%" + new string(' ',(n-2)) + "**" + new string(' ', n-2) + "%");
- }
- Console.WriteLine (new string ('%', 2 * n));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement