Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Matrix,colums with all equal elements
program MatrixColumns; type matrica=array[1..50,1..50] of integer; var a:matrica; n,m:integer; ind:boolean; procedure makematrix(var a:matrica;var n:integer; var m:integer;var ind:boolean); var i,j:integer; begin ind:=false; writeln('Input dimensions of matrix'); read(n,m); if (n>0) and (m>0) then begin ind:=true; writeln('Input elements of matrix:'); for i:=1 to n do for j:=1 to m do repeat read(a[i][j]); until (a[i][j]>=0) and (a[i][j]<=255) end end; procedure wcolumn(a:matrica;i,m:integer); var j:integer; begin for j:=1 to m do write(a[i][j],' '); writeln(); end; procedure processing(a:matrica;n,m:integer); var ind:boolean; i,j:integer; begin writeln('Appropriate colums are:'); for i:=1 to n do begin ind:=true; j:=2; while (j<=m) and (ind) do if (a[i][1]=a[i][j]) then j:=j+1 else ind:=false; if(ind) then wcolumn(a,i,m) end end; procedure writematrix(a:matrica;n,m:integer); var i,j:integer; begin writeln('Your matrix is: '); for i:=1 to n do begin for j:=1 to m do write(a[i][j],' '); writeln() end end; begin makematrix(a,n,m,ind); while(ind) do begin writematrix(a,n,m); processing(a,n,m); makematrix(a,n,m,ind) end end.
run
|
edit
|
history
|
help
0
10_4bhr.pas
nomer3
Genetic Pascal
1
Régua do Tanque Cilindrico Horizontal
zadacha8
Сортировка массива цифр
Pokazivaci, ulancane liste
practica 1 ejercicio 1
practica 5 ejercicio 3