2. Дұрыс анықтамаларды анықтаңыз. А. Массивте элементтер типтері әртүрлі болуы мүмкін B. Python-да массивтер мен тізімдер әртүрлі C. Python-да масивтер мен тізімдер бірдей Д. Python-да массивтермен жұмыс істеу үшін тізімдер қолданылады.
Program ; var min_e, max_e, count, i, j, otn: integer; a: array[1..5, 1..7] of integer; srednee: real; begin for i := 1 to 5 do begin writeln; for j := 1 to 7 do a[i, j] := Random(81); end; max_e := 1; min_e := 81; srednee := 0; for i := 1 to 5 do for j := 1 to 7 do begin if a[i, j] < min_e then min_e := a[i, j]; if a[i, j] > max_e then max_e := a[i, j]; if a[i, j] mod 5 = 0 then begin srednee := srednee + a[i, j]; count := count + 1; end; end; otn := max_e div min_e; srednee := srednee / count; for i := 1 to 5 do begin writeln; for j := 1 to 7 do write(a[i, j]:3); end; writeln; writeln(min_e, ' ', max_e, ' ', otn, ' ', srednee);end.
Var x1, x2, y1, y2: integer; O: boolean; begin write('X1: '); readln(x1); write('Y1: '); readln(y1); write('X2: '); readln(x2); write('Y2: '); readln(y2); if (x1 < 0) and (x2 < 0) and (y1 < 0) and (y2 < 0) then O:=true; if (x1 < 0) and (x2 < 0) and (y1 > 0) and (y2 > 0) then O:=true; if (x1 > 0) and (x2 > 0) and (y1 > 0) and (y2 > 0) then O:=true; if (x1 > 0) and (x2 > 0) and (y1 < 0) and (y2 < 0) then O:=true; if O = true then write('TRUE') else write('FALSE'); end.
var min_e, max_e, count, i, j, otn: integer; a: array[1..5, 1..7] of integer; srednee: real;
begin for i := 1 to 5 do begin writeln; for j := 1 to 7 do a[i, j] := Random(81); end; max_e := 1; min_e := 81; srednee := 0; for i := 1 to 5 do for j := 1 to 7 do begin if a[i, j] < min_e then min_e := a[i, j]; if a[i, j] > max_e then max_e := a[i, j]; if a[i, j] mod 5 = 0 then begin srednee := srednee + a[i, j]; count := count + 1; end; end; otn := max_e div min_e; srednee := srednee / count; for i := 1 to 5 do begin writeln; for j := 1 to 7 do write(a[i, j]:3); end; writeln; writeln(min_e, ' ', max_e, ' ', otn, ' ', srednee);end.
O: boolean;
begin
write('X1: ');
readln(x1);
write('Y1: ');
readln(y1);
write('X2: ');
readln(x2);
write('Y2: ');
readln(y2);
if (x1 < 0) and (x2 < 0) and (y1 < 0) and (y2 < 0) then O:=true;
if (x1 < 0) and (x2 < 0) and (y1 > 0) and (y2 > 0) then O:=true;
if (x1 > 0) and (x2 > 0) and (y1 > 0) and (y2 > 0) then O:=true;
if (x1 > 0) and (x2 > 0) and (y1 < 0) and (y2 < 0) then O:=true;
if O = true then write('TRUE')
else write('FALSE');
end.