-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExStructures.cs
47 lines (44 loc) · 1.09 KB
/
ExStructures.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
using Logique;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace exercices
{
internal class ExStructures : iCommand
{
public string Name => "01_ExStructures";
public void Execute()
{
Point?[,] points = new Point?[5, 5];
for (int i = 0; i < points.GetLength(0); i++)
{
points[i,i] = new Point(i+1,i+1);
}
for (int i = 0;i < points.GetLength(1); i++)
{
for (int j = 0; j < points.GetLength(1); j++)
{
if (points[i,j] is null)
{
Console.Write(new string(' ',13));
}
Console.WriteLine();
}
}
}
}
public struct Point
{
public Point(int x, int y)
{
X = x; Y = y;
}
public int X, Y;
public override string ToString()
{
return $"X : {X} - Y : {Y}";
}
}
}