fbhfd
unknown
csharp
2 years ago
2.1 kB
9
Indexable
using System;
public class Program
{
public static void Main(string[] args)
{
Chapter[] chapters = new Chapter[]
{
new Chapter("Vvedenia", new Document[]
{
new Document("Alemkhan", "Informasia o dokumentasi", "Tut budet INFO O DOK"),
new Document("Alemkhan", "ob avtore", "Tut info pro Avtora")
}),
new Chapter("kak nachinat", new Document[]
{
new Document("Alemkhan", "Instruksia po ustanovke", "Tut vse pro ustanovku"),
new Document("Alemkhan", "trebovania", "Tut trebovania dla ustanovki"),
new Document("Alemkhan", "vozmojnye problemy", "Tut problem ustanovki")
}),
new Chapter ("Raswirenia", new Document[]
{
new Document("Alemkhan", "Kak polzovatsia ", "Tut instruksia ustanovki")
})
};
// relizasia
int index = 1;
Console.WriteLine($"{index} .Nazvania" );
index++;
Console.WriteLine($"{index} .Dokument" );
Console.ReadLine();
}
}
class Document
{
public string Author;
public DateTime CreatedDate;
public DateTime UpdatedDate;
public string Title;
public string Content;
public Document(string author, string title, string content)
{
Author = author;
Title = title;
Content = content;
CreatedDate = DateTime.Now;
UpdatedDate = CreatedDate;
}
public void Print()
{
Console.WriteLine($"Author: {Author}");
Console.WriteLine($"Created Date: {CreatedDate}");
Console.WriteLine($"Updateated Date: {UpdatedDate}");
Console.WriteLine();
Console.WriteLine($"Title: {CreatedDate}");
Console.WriteLine($"Content:\n\t{Content}");
}
}
class Chapter
{
public string Name;
public Document[] Documents;
public Chapter(string name, Document[] documents)
{
Name = name;
Documents = documents;
}
}
Editor is loading...
Leave a Comment