1. Вывести на экран чётные числа по убыванию от a до b.
2. Вывести максимум и минимум на экран.
3. Поменять максимум и минимум местами.
Заранее благодарен.
1.
var
i,a,b,temp: Integer;
begin
readln(a,b);
if a<b then
begin
temp:=a;
a:=b;
b:=temp;
end;
for i:=a downto b do
if not odd(i) then
write(i,' ');
readln;
end.
var
i,a,b,temp: Integer;
begin
readln(a,b);
if a<b then
begin
temp:=a;
a:=b;
b:=temp;
end;
for i:=a downto b do
if not odd(i) then
write(i,' ');
readln;
end.
if not odd(i) thenстроке
Все спасибо сделал, еще бы 2 и 3 задания
Как + в репутацию поставить?
var
i,a,b,temp,max,min: Integer;
begin
readln(a,b);
if a<b then
begin
temp:=a;
a:=b;
b:=temp;
end;
for i:=a downto b do
if not odd(i) then
write(i,' ');
WriteLn;
if a mod 2 = 0 then
max:=a
else
max:=a-1;
if b mod 2 = 0 then
min:=b
else
min:=b+1;
writeLn('max = ',max);
writeLn('min = ',min);
temp:=max;
max:=min;
min:=temp;
writeLn('max = ',max);
writeLn('min = ',min);
readln;
end.