1-B,1-z
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
procedure Button1Click(Sender: TObject);
end;
type Tst= class
pr, nm, cl:string;
o1, o2, o3:integer;
constructor create(a, b, c:string;d, e, l:integer);
function av(v1, v2, v3:integer): real;
end;
mass=array of Tst;
var
Form1: TForm1;
implementation
{$R *.dfm}
constructor Tst.create(a, b, c:string;d, e, l:integer);
begin
pr:=a;
nm:=b;
cl:=c;
o1:=d;
o2:=e;
o3:=l;
end;
function Tst.av (v1, v2, v3:integer): real;
begin
av:= (v1+v2+v3) /3;
end;
procedure TForm1.Button1Click(Sender: TObject);
var f:textfile; n, i, oo1, oo2, oo3:integer;
aa:mass; bb:array of real; pr1, nm1, cl1:string;
sum1, sum2:real;
begin
assignfile(f, 'input.txt');
reset(f);
n:=0;
while not eof(f) do
begin
n:=n+1;
setlength(aa, n);
readln(f, pr1);
readln(f, nm1);
readln(f, cl1);
readln(f, oo1, oo2, oo3);
aa[n-1]:=tst.create(pr1, nm1, cl1, oo1, oo2, oo3);
end;
closefile(f);
for i:= 0 to n-1 do
begin
if aa[i].cl='11-À'
then sum1:=sum1+aa[i].av(aa[i].o1, aa[i].o2, aa[i].o3); ;
if aa[i].cl='11-Á'
then sum2:=sum2+aa[i].av(aa[i].o1, aa[i].o2, aa[i].o3);
end;
if sum1> sum2
then edit1.Text:= '11-À'
else edit1.Text:='11-Á';
end;
end.