### Bookstore

 Computer Math and Games in Pascal (preview) Lazarus Handbook

### Author Topic: Form an array B from the smallest elements of each row A  (Read 121 times)

#### garandr

• Newbie
• Posts: 1
##### Form an array B from the smallest elements of each row A
« on: November 18, 2020, 11:02:44 pm »
Code: Text  [Select][+][-]
1. An array A (m, n) is given. Form an array B from the smallest elements of each row A
2. https://ru.files.fm/u/jbu2kxrws#/view/ta2gfy3k2
3.
Code: Text  [Select][+][-]
1. program Project1;
2. {\$APPTYPE CONSOLE}
3. uses
4. SysUtils;
5. const
6. m=3; n=3;
7.
8. var
9. a: array [1..m, 1..n] of Integer;
10. m,n:integer;
11. begin
12.
13. end;
14. end.

#### Bart

• Hero Member
• Posts: 4030
##### Re: Form an array B from the smallest elements of each row A
« Reply #1 on: November 18, 2020, 11:35:06 pm »
Sounds like homework?

How do you get the lowest (or highest) value form a 1 dimensional array?
Can you describe an algorithm for that (don't think about code yet)?

If you can do that, you can do that for all arrays of the 2 dimensional array (which is in fact an array of an array).

Bart

#### winni

• Hero Member
• Posts: 1992
##### Re: Form an array B from the smallest elements of each row A
« Reply #2 on: November 19, 2020, 12:13:40 am »
Hi!

Same country.
Similar question.
Seems that holidays are over in Russia.

Part of the question was just answered:

https://forum.lazarus.freepascal.org/index.php/topic,52123.msg383651.html#msg383651

Winni