const max=10; var mas:array[1..max] of integer; a,b:integer; countA,countB:integer; i:integer; begin readln (a,b); for i:=1 to max do begin readln (mas[i]); if (mas[i]=a) then countA:=countA+1; if (mas[i]=b) then countB:=countB+1; end;
if (countA>countB) then writeln ('Число' ,a,' встречается больше'); if (countB>countA) then writeln ('Число' ,b, ' встречается больше'); end.
var a: array[1..100] of real; i, n: integer; min, max: real; k: integer;
begin {ввод массива} if handsfree then n := random(20) + 5 else begin write('n = '); readln(n); end;
writeln('Данные массива:'); for i := 1 to n do begin if handsfree then begin a[i] := random(100); write(a[i], ' '); end else readln(a[i]); end; writeln();
{подсчет элементов} k := 0; for i := 1 to n do if a[i] > 5 then k := k + 1; writeln(k); end.
Все задачи однотипные, нужно знать понятия глубины цвета и как расчитывается объём для растрового изображения. 1.всего пикселей 128*128= 2^14(2 в 14-ой степени) так как 32 цвет, то один символ кодируется 5 битами (log2(32), если бы было 33 цвета то уже бы потребовалось 6 бит, так как 5 бы не хватило). Нам нужно в килобайтах значит нужно разделить на 2^13 (т.к. в 1 кбайте 2^13 бит)
const max=10;
var
mas:array[1..max] of integer;
a,b:integer;
countA,countB:integer;
i:integer;
begin
readln (a,b);
for i:=1 to max do
begin
readln (mas[i]);
if (mas[i]=a) then countA:=countA+1;
if (mas[i]=b) then countB:=countB+1;
end;
if (countA>countB) then writeln ('Число' ,a,' встречается больше');
if (countB>countA) then writeln ('Число' ,b, ' встречается больше');
end.