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 ConsoleApplication3
- {
- class Program
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- for(int i =0;i<n;i++)
- {
- if(i==0||i==n-1)
- {
- PrintTopAndBottomPart(n);
- }
- else
- {
- PrintMiddlePart(n, i);
- }
- }
- }
- static void PrintTopAndBottomPart(int n)
- {
- string topAndBottom = new string('*', 2*n);
- string emptySpace = new string(' ', n);
- Console.WriteLine("{0}{1}{0}",topAndBottom,emptySpace);
- }
- static void PrintMiddlePart(int n, int i)
- {
- string Lens = new string('/', 2 * n - 2);
- string middleframe = string.Format("{0}{1}{0}", "*", Lens);
- string Bridge = new string(' ', n);
- if(i==n/2)
- {
- Bridge = new string('|',n);
- }
- Console.WriteLine("{0}{1}{0}",middleframe,Bridge);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement