const n = 5; m = 8; var a:array [1..n,1..8] of char; b:array [1..5] of char; i,j,k,l,s,c,cnt:integer; tmp:char; begin randomize; for i:=1 to n do begin for j:=1 to m do begin a[i,j]:=chr(random(9)+65); k:=random(2); if (k=1) then a[i,j]:=chr(ord(a[i,j])-16); write (a[i,j]:3); end; writeln; end; cnt:=0; for i:=1 to m do begin l:=0; s:=0; inc(cnt); for c:=1 to m do if (ord(a[cnt,c])>=49) and (ord(a[cnt,c])<=57) then s:=s+(ord(a[cnt,c])-48); for j:=1 to n do begin if (ord(a[j,i])>=65) and (ord(a[j,i])<=73) then begin inc(l); b[l]:=a[j,i]; end; end; for c:=1 to l-1 do if b[c+1]>b[c] then begin tmp:=b[c]; b[c]:=b[c+1]; b[c+1]:=tmp; end; for c:=1 to l do write (b[c],' '); writeln ('SUMMA: ',s); end; end.
x,y:real;
end;
var ab,dc,dh,ad,h:real;
a,b,c,d:koords;
begin
writeln ('A:');
write ('X = ');
readln (a.x);
write ('Y = ');
readln (a.y);
writeln ('B:');
write ('X = ');
readln (b.x);
write ('Y = ');
readln (b.y);
writeln ('C:');
write ('X = ');
readln (c.x);
write ('Y = ');
readln (c.y);
writeln ('D:');
write ('X = ');
readln (d.x);
write ('Y = ');
readln (d.y);
ab:=sqrt(sqr(b.x-a.x)+sqr(b.y-a.y));
dc:=sqrt(sqr(c.x-d.x)+sqr(c.y-d.y));
dh:=abs((dc-ab))/2;
ad:=sqrt(sqr(a.x-d.x)+sqr(a.y-d.y));
h:=sqrt(sqr(ad)-sqr(dh));
writeln ('H = ',h:0:4);
readln;
end.
m = 8;
var a:array [1..n,1..8] of char;
b:array [1..5] of char;
i,j,k,l,s,c,cnt:integer;
tmp:char;
begin
randomize;
for i:=1 to n do
begin
for j:=1 to m do
begin
a[i,j]:=chr(random(9)+65);
k:=random(2);
if (k=1) then a[i,j]:=chr(ord(a[i,j])-16);
write (a[i,j]:3);
end;
writeln;
end;
cnt:=0;
for i:=1 to m do
begin
l:=0;
s:=0;
inc(cnt);
for c:=1 to m do
if (ord(a[cnt,c])>=49) and (ord(a[cnt,c])<=57) then s:=s+(ord(a[cnt,c])-48);
for j:=1 to n do
begin
if (ord(a[j,i])>=65) and (ord(a[j,i])<=73) then
begin
inc(l);
b[l]:=a[j,i];
end;
end;
for c:=1 to l-1 do
if b[c+1]>b[c] then
begin
tmp:=b[c];
b[c]:=b[c+1];
b[c+1]:=tmp;
end;
for c:=1 to l do write (b[c],' ');
writeln ('SUMMA: ',s);
end;
end.