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 _4.Draw_a_Filled_Square
- {
- class Program
- {
- public static void PrintHeader(int input)
- {
- Console.WriteLine(new string('-', input * 2));
- }
- public static void PrintMiddleRow(int input)
- {
- Console.Write("-");
- for (int j = 1; j < input; j++)
- {
- Console.Write("\\/");
- }
- Console.WriteLine("-");
- }
- public static void PrintAllMiddleRows(int input)
- {
- for (int i = 0; i < input - 2; i++)
- {
- PrintMiddleRow(input);
- }
- }
- public static void PrintFilledSquare(int input)
- {
- PrintHeader(input);
- PrintAllMiddleRows(input);
- PrintHeader(input);
- }
- static void Main(string[] args)
- {
- int inputNumber = int.Parse(Console.ReadLine());
- PrintFilledSquare(inputNumber);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement