Первая программа:
program n1;
var a: array[1..10] of integer;
i,k:integer;
begin
for i:=1 to 10 do a[i]:=random(100);
K:=0;
For i:=1 to 10 doIf a [i]> 50 then k:=k+1;
Write ('k=', k);
end.
Вторая программа:
i,s:integer;
s:=0;
for i:=1 to 10 doif (a [i]>50) and (a [i]<60) then s:=s+a [i];
write ('s=', s);
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Первая программа:
program n1;
var a: array[1..10] of integer;
i,k:integer;
begin
for i:=1 to 10 do a[i]:=random(100);
K:=0;
For i:=1 to 10 doIf a [i]> 50 then k:=k+1;
Write ('k=', k);
end.
Вторая программа:
program n1;
var a: array[1..10] of integer;
i,s:integer;
begin
for i:=1 to 10 do a[i]:=random(100);
s:=0;
for i:=1 to 10 doif (a [i]>50) and (a [i]<60) then s:=s+a [i];
write ('s=', s);
end.