theme changed

This commit is contained in:
nik
2025-09-30 08:21:09 +03:00
parent 4c261f7def
commit 8bd93df2ae
917 changed files with 15023 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
using System;
abstract class Person
{
public string LastName { get; }
public DateTime BirthDate { get; }
protected Person(string lastName, DateTime birthDate)
{
LastName = lastName;
BirthDate = birthDate;
}
public int Age()
{
var today = DateTime.Today;
int a = today.Year - BirthDate.Year;
if (BirthDate.Date > today.AddYears(-a)) a--;
return a;
}
public virtual void Show()
{
Console.WriteLine("{0}, возраст: {1}", LastName, Age());
}
}