Essays.club - Получите бесплатные рефераты, курсовые работы и научные статьи
Поиск

Контрольная работа по "Информатике"

Автор:   •  Декабрь 17, 2018  •  Контрольная работа  •  1,297 Слов (6 Страниц)  •  304 Просмотры

Страница 1 из 6

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

...

Скачать:   txt (10 Kb)   pdf (44.2 Kb)   docx (14.8 Kb)  
Продолжить читать еще 5 страниц(ы) »
Доступно только на Essays.club