Запишите полные тексты следующих программ: 1. s: =0 for i: =1 to 10 do if (a [i]> 50) and ( a [i]< 60) then s: =s+a [i] write (`s=`,s) 2. k: =0 for i: =1 to 10 do if a [i]> 50 then k: =k+1 write (`k=`,k)
1. var a:array[1..10] of integer; i,s:integer; begin Randomize; for i:=1 to 10 do begin a[i]:=random(81); write(a[i]:3); end; writeln; s:=0; For i:=1 to 10 do If (a[i]>50) and (a[i]<60) then s:=s+a[i]; Write ('s=',s); end.
2. var a:array[1..10] of integer; i,k:integer; begin Randomize; for i:=1 to 10 do begin a[i]:=random(81); write(a[i]:3); end; writeln; k:=0; For i:=1 to 10 do If a[i]>50 then k:=k+1; Write ('k=',k) end.
var a:array[1..10] of integer;
i,s:integer;
begin
Randomize;
for i:=1 to 10 do begin
a[i]:=random(81);
write(a[i]:3);
end;
writeln;
s:=0;
For i:=1 to 10 do
If (a[i]>50) and (a[i]<60) then s:=s+a[i];
Write ('s=',s);
end.
2.
var a:array[1..10] of integer;
i,k:integer;
begin
Randomize;
for i:=1 to 10 do begin
a[i]:=random(81);
write(a[i]:3);
end;
writeln;
k:=0;
For i:=1 to 10 do
If a[i]>50 then k:=k+1;
Write ('k=',k)
end.