Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program test;
- const
- max_m = 100;
- max_n = 100;
- var
- arr: array[1..max_m,1..max_n] of integer;
- m,n: integer;
- col,row: integer;
- minimal: integer;
- begin
- repeat
- write('Enter m (from 1 to 100): '); readln(m);
- until (m>=1) and ( m<=100);
- repeat
- write('Enter n (from 1 to 100): '); readln(n);
- until (n>=1) and (m<=100);
- writeln(); {newline}
- for row:=1 to m do
- for col:=1 to n do
- begin
- write('Enter value of ',col,' column, ',row,' row: '); readln(arr[row,col]);
- end;
- minimal := arr[1,1];
- for row:=1 to m do
- for col:=1 to n do
- if arr[row,col]<minimal then
- minimal := arr[row,col];
- writeln(); {newline}
- writeln('Minimal element is ',minimal);
- for row:=1 to m do
- for col:=1 to n do
- if arr[row,col]=minimal then
- begin
- writeln('Minimal element present in ',row,' row');
- break;
- end;
- readln();
- end.
Advertisement
Add Comment
Please, Sign In to add comment