Program rabota_01; var a,b,c,d : integer; begin for a: =1 to 4 do for b: =a+1 to 4 do for c: =b+1 to 4 do for d: =c+1 to 4 do writeln(a: 3,b: 3,c: 3,d: 3); for a: =1 to 4 do for b: =a+1 to 4 do for c: =b+1 to 4 do writeln(a: 3,b: 3,c: 3); for a: =1 to 4 do for b: =a+1 to 4 do writeln(a: 3,b: 3); for a: =1 to 4 do writeln(a: 3); readln; end.
shurshin6975
25.01.2021
Const n=10; type mas=array[1..3*n] of integer; procedure ins(var a: mas; k,nom: integer); var i: integer; begin for i: =3*n downto nom+3 do a[i]: =a[i-2]; a[nom+1]: =a[nom]; a[nom]: =k; a[nom+2]: =k; end; var b : mas; k,i,j : integer; begin randomize; for i: =1 to n do begin b[i]: =random(51); write(b[i]: 4); end; writeln; write('k='); readln(k); j: =1; for i: =1 to n do if (b[j] mod 10 = k mod 10) then begin ins(b,k,j); j: =j+3 end else j: =j+1; for i: =1 to 3*n do write(b[i]: 4); writeln; end.