1. Program A1; var s,m:integer; begin Writeln('Vvedi vozrast SASHI :'); Read(s); Writeln('Vvedi vozrast MASHI :'); Read(m); If s>m then writeln('SASHA starshe MASHI') else writeln('MASHA starshe SASHI'); end.
2. Program A1; var s,m:integer; begin Writeln('Vvedi vozrast SASHI :'); Read(s); Writeln('Vvedi vozrast MASHI :'); Read(m); If s=m then writeln('SASHA i MASHA rovestniki') else If s>m then writeln('SASHA starshe MASHI') else writeln('MASHA starshe SASHI'); end.
3. Program A1; var a,b,c,d:real; begin Readln(a); Readln(b); Readln(c); If ((b<a) and (b<c)) then begin d:=a; a:=b; b:=d; end; If ((c<a) and (c<b)) then begin d:=a; a:=c; c:=d; end; If ((a>b) and (a<c)) then begin d:=b; b:=a; a:=d; end; If ((c<b) and (c>a)) then begin d:=b; b:=c; c:=d; end; If ((a>c) and (a>b)) then begin d:=c; c:=a; a:=d; end; If ((b>c) and (b>a)) then begin d:=c; c:=b; b:=d; end; writeln(a,'<',b,'<',c); end.
Const n=3; var a: array[1..n] of integer; i, j, k: integer; begin randomize; write ('Исходный массив: '); for i := 1 to n do begin a[i] := random(256); write (a[i]:4); end; writeln; writeln; for i := 1 to n-1 do for j := 1 to n-i do if a[j] > a[j+1] then begin k := a[j]; a[j] := a[j+1]; a[j+1] := k end; write ('массив по возрастанию: '); for i := 1 to n do write(а[i]:4); writeln; readln; end.
var
s,m:integer;
begin
Writeln('Vvedi vozrast SASHI :');
Read(s);
Writeln('Vvedi vozrast MASHI :');
Read(m);
If s>m then writeln('SASHA starshe MASHI') else writeln('MASHA starshe SASHI');
end.
2.
Program A1;
var
s,m:integer;
begin
Writeln('Vvedi vozrast SASHI :');
Read(s);
Writeln('Vvedi vozrast MASHI :');
Read(m);
If s=m then writeln('SASHA i MASHA rovestniki') else
If s>m then writeln('SASHA starshe MASHI') else writeln('MASHA starshe SASHI');
end.
3.
Program A1;
var
a,b,c,d:real;
begin
Readln(a);
Readln(b);
Readln(c);
If ((b<a) and (b<c)) then begin d:=a; a:=b; b:=d; end;
If ((c<a) and (c<b)) then begin d:=a; a:=c; c:=d; end;
If ((a>b) and (a<c)) then begin d:=b; b:=a; a:=d; end;
If ((c<b) and (c>a)) then begin d:=b; b:=c; c:=d; end;
If ((a>c) and (a>b)) then begin d:=c; c:=a; a:=d; end;
If ((b>c) and (b>a)) then begin d:=c; c:=b; b:=d; end;
writeln(a,'<',b,'<',c);
end.
var a: array[1..n] of integer;
i, j, k: integer;
begin
randomize;
write ('Исходный массив: ');
for i := 1 to n do begin
a[i] := random(256);
write (a[i]:4); end;
writeln; writeln;
for i := 1 to n-1 do
for j := 1 to n-i do
if a[j] > a[j+1] then begin
k := a[j];
a[j] := a[j+1];
a[j+1] := k
end;
write ('массив по возрастанию: ');
for i := 1 to n do
write(а[i]:4);
writeln;
readln;
end.