/
n-dimens
/
pascalabcnet
Обзор
Документация
Войти
/
n-dimens
/
pascalabcnet
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
3.0
InstallerSamples/LanguageFeatures/Students.pas
39 строк
892 B
Бондарев Иван
initial commit
14 май 2015, 22:35
14 май 2015, 22:35
e6e67c1
Код
Авторство
О чём код?
//���������� ���������� type Student = class Name: string; Height: integer; public constructor(Name: string; Height: integer); begin Self.Name := Name; Self.Height := Height; end; class function operator<(left,right: Student): boolean; // ��������� �� ����� begin Result := left.Height < right.Height; end; class function operator>(left,right: Student): boolean; begin Result := left.Height > right.Height; end; function ToString: string; override; begin Result := string.Format('{0} ({1})', Name, Height); end; end; var s1,s2: Student; begin s1 := new Student('Stepa Morkovkin',188); s2 := new Student('Petya Pomidorov',180); Writeln('s1: ',s1); Writeln('s2: ',s2); Writeln; Writeln('s1<s2: ',s1<s2); // Writeln('Student.operator>(s1,s2): ',Student.operator>(s1,s2)); end.