SHOW:
|
|
- or go back to the newest paste.
1 | - | using System; |
1 | + | using System; |
2 | - | class Eggcelent |
2 | + | class Eggcelent |
3 | - | { |
3 | + | { |
4 | - | static void Main() |
4 | + | static void Main() |
5 | - | { |
5 | + | { |
6 | - | int n = int.Parse(Console.ReadLine()); |
6 | + | int n = int.Parse(Console.ReadLine()); |
7 | - | int height = 2 * n; |
7 | + | int height = 2 * n; |
8 | - | int width = (3 * n) - 1; |
8 | + | int width = (3 * n) - 1; |
9 | - | int widthD = (3 * n) + 1; |
9 | + | int widthD = (3 * n) + 1; |
10 | - | int top = n - 1; |
10 | + | int top = n - 1; |
11 | - | int bottom = n - 1; |
11 | + | int bottom = n - 1; |
12 | - | //Top |
12 | + | //Top |
13 | - | Console.WriteLine("{0}{1}{0}",new string('.',n + 1),new string('*',top)); |
13 | + | Console.WriteLine("{0}{1}{0}",new string('.',n + 1),new string('*',top)); |
14 | - | int outerDots = n - 1; |
14 | + | int outerDots = n - 1; |
15 | - | int innerDots = n + 1; |
15 | + | int innerDots = n + 1; |
16 | - | int counter = 0; |
16 | + | int counter = 0; |
17 | - | for (int i = 0; i < height - n - 2; i++) |
17 | + | for (int i = 0; i < height - n - 2; i++) |
18 | - | { |
18 | + | { |
19 | - | Console.WriteLine("{0}*{1}*{0}",new string('.',outerDots),new string('.',innerDots)); |
19 | + | Console.WriteLine("{0}*{1}*{0}",new string('.',outerDots),new string('.',innerDots)); |
20 | - | innerDots+=4; |
20 | + | innerDots+=4; |
21 | - | outerDots-=2; |
21 | + | outerDots-=2; |
22 | - | if (outerDots < 0) |
22 | + | if (outerDots < 0) |
23 | - | { |
23 | + | { |
24 | - | outerDots = 1; |
24 | + | outerDots = 1; |
25 | - | counter++; |
25 | + | counter++; |
26 | - | } |
26 | + | } |
27 | - | if (innerDots > width) |
27 | + | if (innerDots > width) |
28 | - | { |
28 | + | { |
29 | - | innerDots = width - 2; |
29 | + | innerDots = width - 2; |
30 | - | } |
30 | + | } |
31 | - | } |
31 | + | } |
32 | - | //Middle |
32 | + | //Middle |
33 | - | Console.Write(".*"); |
33 | + | Console.Write(".*"); |
34 | - | for (int i = 0; i < width/2; i++) |
34 | + | for (int i = 0; i < width/2; i++) |
35 | - | { |
35 | + | { |
36 | - | Console.Write("@"); |
36 | + | Console.Write("@"); |
37 | - | if(i > width/2-2) |
37 | + | if(i > width/2-2) |
38 | - | { |
38 | + | { |
39 | - | break; |
39 | + | break; |
40 | - | } |
40 | + | } |
41 | - | Console.Write("."); |
41 | + | Console.Write("."); |
42 | - | } |
42 | + | } |
43 | - | Console.WriteLine("*."); |
43 | + | Console.WriteLine("*."); |
44 | - | Console.Write(".*"); |
44 | + | Console.Write(".*"); |
45 | - | for (int i = 0; i < width / 2; i++) |
45 | + | for (int i = 0; i < width / 2; i++) |
46 | - | { |
46 | + | { |
47 | - | Console.Write("."); |
47 | + | Console.Write("."); |
48 | - | if (i > width / 2 - 2) |
48 | + | if (i > width / 2 - 2) |
49 | - | { |
49 | + | { |
50 | - | break; |
50 | + | break; |
51 | - | } |
51 | + | } |
52 | - | Console.Write("@"); |
52 | + | Console.Write("@"); |
53 | - | } |
53 | + | } |
54 | - | Console.WriteLine("*."); |
54 | + | Console.WriteLine("*."); |
55 | - | //Bottom |
55 | + | //Bottom |
56 | - | int innerDots2 = 1; |
56 | + | int innerDots2 = 1; |
57 | - | int outerDots2 = width - 2; |
57 | + | int outerDots2 = width - 2; |
58 | - | for (int i = 0; i < height - n - 2; i++) |
58 | + | for (int i = 0; i < height - n - 2; i++) |
59 | - | { |
59 | + | { |
60 | - | Console.WriteLine("{0}*{1}*{0}", new string('.', innerDots2), new string('.', outerDots2)); |
60 | + | Console.WriteLine("{0}*{1}*{0}", new string('.', innerDots2), new string('.', outerDots2)); |
61 | - | if (counter-1 > i) |
61 | + | if (counter-1 > i) |
62 | - | { |
62 | + | { |
63 | - | innerDots2 = widthD - width - 1; |
63 | + | innerDots2 = widthD - width - 1; |
64 | - | outerDots2 = width - 2; |
64 | + | outerDots2 = width - 2; |
65 | - | } |
65 | + | } |
66 | - | else |
66 | + | else |
67 | - | { |
67 | + | { |
68 | - | innerDots2 += 2; |
68 | + | innerDots2 += 2; |
69 | - | outerDots2 -= 4; |
69 | + | outerDots2 -= 4; |
70 | - | } |
70 | + | } |
71 | - | } |
71 | + | } |
72 | - | Console.WriteLine("{0}{1}{0}",new string('.',n +1),new string('*',bottom)); |
72 | + | Console.WriteLine("{0}{1}{0}",new string('.',n +1),new string('*',bottom)); |
73 | - | } |
73 | + | } |
74 | } |