Контрольная работа по "Информатике"
Автор: AlexBrown8 • Декабрь 17, 2018 • Контрольная работа • 1,297 Слов (6 Страниц) • 298 Просмотры
program zamena_oborudovaniya;
const p=10;
var i,j,k,n:integer;
g:array[0..100] of integer; f:array[0..100,0..100] of integer;
function max(a,b:integer):integer;begin if a>b then max:=a else max:=b; end;
begin write('n=?');
readln(n);
for j:=0 to n do
begin write('g[',j,']='); readln(g[j]);end;
for j:=0 to n do f[0,j]:=g[j];
for j:=0 to n do f[1,j]:=max(g[j],-p+g[0]);
for i:=2 to n do for j:=0 to n-1 do
begin f[i,j]:=max(g[j]+f[i-1,j+1],-p+g[0]+f[i-1,1]);end;
for i:=0 to n do begin
for j:=0 to n do
begin write(f[i,j],' '); end;
writeln;end;
end.
program zamena_oborudovaniya;
const p=10;
var i,j,k,n:integer;
g:array[0..100] of integer; f:array[0..100,0..100] of integer;
function max(a,b:integer):integer;begin if a>b then max:=a else max:=b; end;
begin write('n=?');
readln(n);
for j:=0 to n do
begin write('g[',j,']='); readln(g[j]);end;
for j:=0 to n do f[0,j]:=g[j];
for j:=0 to n do f[1,j]:=max(g[j],-p+g[0]);
for i:=2 to n do for j:=0 to n-1 do
begin f[i,j]:=max(g[j]+f[i-1,j+1],-p+g[0]+f[i-1,1]);end;
for i:=0 to n do begin
for j:=0 to n do
begin write(f[i,j],' '); end;
writeln;end;
end.
program zamena_oborudovaniya;
const p=10;
var i,j,k,n:integer;
g:array[0..100] of integer; f:array[0..100,0..100] of integer;
function max(a,b:integer):integer;begin if a>b then max:=a else max:=b; end;
begin write('n=?');
readln(n);
for j:=0 to n do
begin write('g[',j,']='); readln(g[j]);end;
for j:=0 to n do f[0,j]:=g[j];
for j:=0 to n do f[1,j]:=max(g[j],-p+g[0]);
for i:=2 to n do for j:=0 to n-1 do
begin f[i,j]:=max(g[j]+f[i-1,j+1],-p+g[0]+f[i-1,1]);end;
for i:=0 to n do begin
for j:=0 to n do
begin write(f[i,j],' '); end;
writeln;end;
end.
program zamena_oborudovaniya;
const p=10;
var i,j,k,n:integer;
g:array[0..100] of integer; f:array[0..100,0..100] of integer;
function max(a,b:integer):integer;begin if a>b then max:=a else max:=b; end;
begin write('n=?');
readln(n);
for j:=0 to n do
begin write('g[',j,']='); readln(g[j]);end;
for j:=0 to n do f[0,j]:=g[j];
for j:=0 to n do f[1,j]:=max(g[j],-p+g[0]);
for i:=2 to n do for j:=0 to n-1 do
begin f[i,j]:=max(g[j]+f[i-1,j+1],-p+g[0]+f[i-1,1]);end;
for i:=0 to n do begin
for j:=0 to n do
begin write(f[i,j],' '); end;
writeln;end;
end.
program zamena_oborudovaniya;
const p=10;
var i,j,k,n:integer;
g:array[0..100] of integer; f:array[0..100,0..100] of integer;
function max(a,b:integer):integer;begin if a>b then max:=a else max:=b; end;
begin write('n=?');
readln(n);
for j:=0 to n do
begin write('g[',j,']='); readln(g[j]);end;
for j:=0 to n do f[0,j]:=g[j];
for j:=0 to n do f[1,j]:=max(g[j],-p+g[0]);
for i:=2 to n do for j:=0 to n-1 do
begin f[i,j]:=max(g[j]+f[i-1,j+1],-p+g[0]+f[i-1,1]);end;
for i:=0 to n do begin
for j:=0 to n do
begin write(f[i,j],' '); end;
writeln;end;
end.
program zamena_oborudovaniya;
const p=10;
var i,j,k,n:integer;
g:array[0..100] of integer; f:array[0..100,0..100] of integer;
function max(a,b:integer):integer;begin if a>b then max:=a else max:=b; end;
begin write('n=?');
readln(n);
for j:=0 to n do
begin write('g[',j,']='); readln(g[j]);end;
for
...