1. var a: array[1..10] of integer; i, kol: Integer; Begin for i := 1 to 10 do read(a[i]); kol := 0; for i := 1 to 10 do if a[i] mod 2=0 then begin kol := kol + 1; write(a[i],' '); end; writeln; writeln(kol); End. 2. var a: array[1..10] of integer; i, kol: Integer; Begin for i := 1 to 10 do read(a[i]); kol := 0; for i := 1 to 10 do if a[i] > 9 then begin kol := kol + 1; write(a[i],' '); end; writeln; writeln(kol); End. 3. var a: array[1..10] of integer; i: Integer; Begin for i := 1 to 10 do read(a[i]); for i := 1 to 10 do if a[i] mod 2=0 then write(a[i],' '); for i := 1 to 10 do if a[i] mod 2=1 then write(a[i],' '); End. 4. var a: array[1..10] of integer; i, r: Integer; Begin for i := 1 to 10 do read(a[i]); i := 1; while i < 10 do if a[i+1] < a[i] then begin r := a[i+1]; a[i+1] := a[i]; a[i] := r; i := 1; end else i := i + 1; for i := 1 to 10 do if a[i] mod 2=0 then write(a[i],' '); for i := 1 to 10 do if a[i] mod 2=1 then write(a[i],' '); End. 5. var a: array[1..10] of integer; i, kol: Integer; Begin for i := 1 to 10 do read(a[i]); for i := 1 to 10 do if a[i] mod 10 = 5 then kol := kol + 1; writeln(kol); End.
i, kol: Integer;
Begin
for i := 1 to 10 do read(a[i]);
kol := 0;
for i := 1 to 10 do
if a[i] mod 2=0 then
begin
kol := kol + 1;
write(a[i],' ');
end;
writeln;
writeln(kol);
End.
2. var a: array[1..10] of integer;
i, kol: Integer;
Begin
for i := 1 to 10 do read(a[i]);
kol := 0;
for i := 1 to 10 do
if a[i] > 9 then
begin
kol := kol + 1;
write(a[i],' ');
end;
writeln;
writeln(kol);
End.
3. var a: array[1..10] of integer;
i: Integer;
Begin
for i := 1 to 10 do read(a[i]);
for i := 1 to 10 do
if a[i] mod 2=0 then write(a[i],' ');
for i := 1 to 10 do
if a[i] mod 2=1 then write(a[i],' ');
End.
4. var a: array[1..10] of integer;
i, r: Integer;
Begin
for i := 1 to 10 do read(a[i]);
i := 1;
while i < 10 do
if a[i+1] < a[i] then begin
r := a[i+1];
a[i+1] := a[i];
a[i] := r;
i := 1;
end else i := i + 1;
for i := 1 to 10 do
if a[i] mod 2=0 then write(a[i],' ');
for i := 1 to 10 do
if a[i] mod 2=1 then write(a[i],' ');
End.
5. var a: array[1..10] of integer;
i, kol: Integer;
Begin
for i := 1 to 10 do read(a[i]);
for i := 1 to 10 do
if a[i] mod 10 = 5 then kol := kol + 1;
writeln(kol);
End.
1.
1) s := (x1+x2)/2
2) dec(k) или k:=k-1
3) inc(i) или i:=i+1
4) sum := t*kt + r*kr + k*kk (t, r, k - цена одной тетради, ручки, карандаша; kt, kr, kk - количество тетрадей, ручек и карандашей)
2.
а) значения функции y=х(в квадрате)
var y,x: real
б) площади прямоугольника
var a,b,s: real
в)стоимости покупки,состоящей из нескольких тетрадей и такого же кол-ва обложек
var kv:integer; st,so,sum: real
г)стоимости покупки,состоящей из нескольких тетрадей,нескольких ручек и нескольких карандашей
var kvt,kvr,kvk:integer; st,sr,sk,sum: real