Uses crt; var b:array [1..10] of real; min,max,x:integer; sum,pr,t:real; begin sum:=0; pr:=1; for x:=1 to 10 do begin write('b[',x,']:'); readln(b[x]); end; min:=1; max:=1; for x:=1 to 10 do begin if b[x]<b[min] then min:=x; if b[x]>b[max] then max:=x; end; t:=b[min]; b[min]:=b[max]; b[max]:=t; if max>=min then for x:=min+1 to max-1 do sum:=sum+b[x] else for x:=max+1 to min-1 do sum:=sum+b[x]; for x:=1 to 10 do if b[x]<0 then pr:=pr*b[x]; for x:=1 to 10 do write(b[x],' '); writeln; writeln(sum); writeln(pr); end.
A)var k,n:integer; begin read(k); if k div 7=k/7 then n:=7 else if k+1 div 7=k+1/7 then n:=6 else if k+2 div 7=k+2/7 then n:=5 else if k+3 div 7=k+3/7 then n:=4 else if k+4 div 7=k+4/7 then n:=3 else if k+5 div 7=k+5/7 then n:=2 else if k+6 div 7=k+6/7 then n:=1; writeln(n); end. б)var k,n:integer;begin read(k); if k-1 div 7=k-1/7 then n:=7 else if k div 7=k/7 then n:=6 else if k+1 div 7=k+1/7 then n:=5 else if k+2 div 7=k+2/7 then n:=4 else if k+3 div 7=k+3/7 then n:=3 else if k+4 div 7=k+4/7 then n:=2 else if k+5 div 7=k+5/7 then n:=1; writeln(n); end.
var b:array [1..10] of real;
min,max,x:integer;
sum,pr,t:real;
begin
sum:=0; pr:=1;
for x:=1 to 10 do
begin
write('b[',x,']:'); readln(b[x]);
end;
min:=1; max:=1;
for x:=1 to 10 do
begin
if b[x]<b[min] then min:=x;
if b[x]>b[max] then max:=x;
end;
t:=b[min];
b[min]:=b[max];
b[max]:=t;
if max>=min then
for x:=min+1 to max-1 do
sum:=sum+b[x]
else
for x:=max+1 to min-1 do
sum:=sum+b[x];
for x:=1 to 10 do
if b[x]<0 then pr:=pr*b[x];
for x:=1 to 10 do
write(b[x],' ');
writeln; writeln(sum);
writeln(pr);
end.
begin
read(k);
if k div 7=k/7 then n:=7 else
if k+1 div 7=k+1/7 then n:=6 else
if k+2 div 7=k+2/7 then n:=5 else
if k+3 div 7=k+3/7 then n:=4 else
if k+4 div 7=k+4/7 then n:=3 else
if k+5 div 7=k+5/7 then n:=2 else
if k+6 div 7=k+6/7 then n:=1;
writeln(n);
end.
б)var k,n:integer;begin
read(k);
if k-1 div 7=k-1/7 then n:=7 else
if k div 7=k/7 then n:=6 else
if k+1 div 7=k+1/7 then n:=5 else
if k+2 div 7=k+2/7 then n:=4 else
if k+3 div 7=k+3/7 then n:=3 else
if k+4 div 7=k+4/7 then n:=2 else
if k+5 div 7=k+5/7 then n:=1;
writeln(n);
end.