Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace DrawFort
- {
- class Program
- {
- static void Main(string[] args)
- {
- // User input
- int n = int.Parse(Console.ReadLine());
- int width = 2 * n;
- // Top part
- int accentCount = n / 2;
- int underlineCount = width - 2 * (accentCount + 2);
- Console.WriteLine("/{0}\\{1}/{0}\\",
- new string('^', accentCount),
- new string('_', underlineCount));
- // Middle part
- for ( int i = 0; i < n - 2; i++ )
- {
- if ( i == n - 3 )
- {
- Console.WriteLine("|{0}{1}{0}|",
- new string(' ', n / 2 + 1),
- new string('_', underlineCount));
- }
- else
- {
- Console.WriteLine("|{0}|", new string(' ', width - 2));
- }
- }
- // Bottom part
- Console.WriteLine("\\{0}/{1}\\{0}/",
- new string('_', accentCount),
- new string(' ', underlineCount));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement