Program prog;
uses crt;
var a:array[1..201] of integer;
s,i: integer;
begin
clrscr;
for i:=1 to 201 do
a[i]:=i+100;
for i:=1 to 201 do begin
if a[i] mod 2=1 then begin
s:=s+a[i];
write(a[i],' ');
end;
end;
writeln; writeln;
writeln('Сумма s = ', s);
end.
1 байт=4 битам 4x32=128 байтов
Program massivy;
var array1: array [1..10] of integer;
i, b:integer;
begin
for i:=1 to 10 do
array1[i]:=random(-10, 10);
for i:=1 to 4 do begin
for b:=1 to 4 do
if array1[b] > array1[b+1] then
swap(array1[b], array1[b+1]);
end;
for i:=5 to 9 do begin
for b:=5 to 9 do
if array1[b] < array1[b+1] then
swap(array1[b], array1[b+1]);
end;
for i:=1 to 10 do
writeln(array1[i]);
end.
Program Project2;
{$APPTYPE CONSOLE}
uses SysUtils,windows;constnMin=1;nMax=20;typemas=array[nMin..Nmax] of integer;
Vara:mas; i:integer;s:real;begin setconsoleCP(1251); setconsoleOutPutCp(1251); randomize;
for i:=1 to nMax doa[i]:=random(1000)-500;writeln ('Ìàññèâ:'); for i:=1 to nMax do beginwrite ('');write (a[i]:2);writeln ('');end;s:=0;for i:=1 to Nmax dobeginIf a[i]<0 thens:=s+a[i];end;writeln ('Ñóììà îòðèöàòåëüíûõ ýëåìåíòîâ ìàññèâà = ',s:2:2);readln;end.<span>
</span>