Выделите на листе прямоугольную область ячеек с левым верхним углов в a1 и запустите программу, которая в каждой строке выделенной области обменяет местами содержимое ячеек с минимальным и максимальным значениями. sub abc() a = selection.value for i = 1 to ubound(a, 1) amin = a(i, 1): amax = amin jmin = 1: jmax = 1 for j = 2 to ubound(a, 2) if amin > a(i, j) then amin = a(i, j): jmin = j end if if amax < a(i, j) then amax = a(i, j): jmax = j end if next j cells(i, jmin).value = amax cells(i, jmax).value = amin next i end sub
Yelena642
22.09.2021
Var a: array [1..100] of integer; n, i, j: integer; fout: text; begin assign(fout, 'output.txt'); rewrite(fout); n : = 10; //n - длина массива for i : = 1 to n do a[i] : = random(100); for i : = 1 to n do write(fout, a[i], ' '); writeln(fout); j : = 1; for i : = 2 to n do if a[i] > a[j] then j : = i; writeln(fout, 'max = ', a[j], ' max_ind = ', j); j : = 1; for i : = 2 to n do if a[i] < a[j] then j : = i; writeln(fout, 'min = ', a[j], ' min_ind = ', j); close(fout); end.
var d,i: integer;
s: string;
begin
read(d);
s: =str(d);
for i: = 1 to length(s) do
if int(s[i]) mod 2=0 then
writeln(s[i]);
end.