-
Notifications
You must be signed in to change notification settings - Fork 5
/
P04_DrawAFilledSquare.cs
39 lines (34 loc) · 980 Bytes
/
P04_DrawAFilledSquare.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
namespace P04_DrawAFilledSquare
{
class P04_DrawAFilledSquare
{
static void Main(string[] args)
{
int squareSize = int.Parse(Console.ReadLine());
PrintFilledSquare(squareSize);
}
static void PrintFilledSquare(int squareSize)
{
PLinerintSquareTopBottom(squareSize);
for (int i = 0; i < squareSize - 2; i++)
{
PrintSquareMiddleLine(squareSize);
}
PLinerintSquareTopBottom(squareSize);
}
static void PrintSquareMiddleLine(int squareSize)
{
Console.Write("-");
for (int i = 0; i < squareSize - 1; i++)
{
Console.Write("\\/");
}
Console.WriteLine("-");
}
static void PLinerintSquareTopBottom(int squareSize)
{
Console.WriteLine(new string('-', squareSize *2));
}
}
}