added sol for feladat 1

This commit is contained in:
Digi
2025-03-14 22:32:46 +01:00
parent 63a0218e9d
commit 8a8c57969a
20 changed files with 270 additions and 94 deletions

View File

@@ -9,34 +9,9 @@ namespace Program
internal class Doboz
{
public char Type { get; set; }
public Doboz Children = null;
public Doboz Parent = null;
public Doboz(char Type) {
this.Type = Type;
}
public void AddChildren(Doboz doboz)
{
doboz.Parent = this;
this.Children = doboz;
}
public void PrintBoxContent(int indent = 0)
{
string indentStr = "";
for (int i = 0; i < indent; i++)
{
indentStr += "->";
}
Console.WriteLine($"{indentStr}{this.Type}");
if (this.Children != null)
{
this.Children.PrintBoxContent(indent + 1);
}
}
}
}