-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
56 lines (52 loc) · 1.68 KB
/
Program.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
class Eclipse
{
static void Main()
{
int n = int.Parse(Console.ReadLine());
char star = '*';
char dash = '-';
char slash = '/';
char space = ' ';
//first line
for (int i = 0; i < 1; i++)
{
Console.Write(space);
Console.Write(new string (star, 2*n-2));
Console.Write(new string(space, n + 1));
Console.Write(new string(star, 2 * n - 2));
Console.WriteLine(space);
}
//between first and last lines
for (int i = 2; i < n; i++)
{
Console.Write(star);
Console.Write(new string(slash, 2*n-2));
Console.Write(star);
if (i == n / 2 + 1)
{
Console.Write(new string(dash, n - 1));
}
else
{
Console.Write(new string(space, n - 1));
}
Console.Write(star);
Console.Write(new string(slash, 2 * n - 2));
Console.WriteLine(star);
}
//last line the same as first line
for (int i = 0; i < 1; i++)
{
Console.Write(space);
Console.Write(new string(star, 2 * n - 2));
Console.Write(new string(space, n + 1));
Console.Write(new string(star, 2 * n - 2));
Console.WriteLine(space);
}
}
}