As an investor, I always check the stock market in order to find good companies to invest in. Recently, I found that the best companies to invest in, are the ones that have largest sum formed by a strictly increasing set of numbers (a set where the next element is always greater than the current element). But before I invest, I need to know the position of the first element of the consecutive increasing numbers. Help me so we can start investing already! Note: If it is already the last element of the row in the array, the next element is the first element of the next row, if there exists a next row. Input 1. Number of rows Description This is the number of rows of the multidimensional array. 2. Number of columns Description This is the number of columns of the multidimensional array. 3. Elements of the multidimensional array Output The first line will contain a message prompt to input the number of rows. The second line will contain a message prompt to input the number of columns. The succeeding lines will contain the elements of the input multidimensional array. Finally, the last line will contain the position (row, col) of the first element of the consecutive increasing number. Enter·number·of·rows:·3 Enter·number·of·columns:·4 1·1·2·3 5·8·2·1 3·2·0·5 Position:·0,·1 C++ only
As an investor, I always check the stock market in order to find good companies to invest in. Recently, I found that the best companies to invest in, are the ones that have largest sum formed by a strictly increasing set of numbers (a set where the next element is always greater than the current element). But before I invest, I need to know the position of the first element of the consecutive increasing numbers. Help me so we can start investing already!
Note: If it is already the last element of the row in the array, the next element is the first element of the next row, if there exists a next row.
Input
1. Number of rows
Description
This is the number of rows of the multidimensional array.
2. Number of columns
Description
This is the number of columns of the multidimensional array.
3. Elements of the multidimensional array
Output
The first line will contain a message prompt to input the number of rows. The second line will contain a message prompt to input the number of columns. The succeeding lines will contain the elements of the input multidimensional array. Finally, the last line will contain the position (row, col) of the first element of the consecutive increasing number.
Enter·number·of·columns:·4
1·1·2·3
5·8·2·1
3·2·0·5
Position:·0,·1
C++ only
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images