Hello chebyrek,
I am thinking this might work better for you to start with:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
const int del = 3;
//const int size = 5;
constexpr int MAXROWS{ 15 };
constexpr int MAXCOLS{ 5 };
int numArray[MAXROWS][MAXCOLS]{};
|
The 2D array would make life much easier. Consider what you would need if the number of arrays increased to 100. That would mean 85 additional lines to create the arrays and another 425 lines or maybe more for the for loops to fill each array.
A short nested for loop could fill the array with the least amount of work.
The for loop at line 104 works for just 1 array only.
From line 108 on the {} around the if statement are not needed. Your next problem:
1 2
|
if (arr2[i] >= del)
cout << arr2[i] << endl;
|
Would actually look like:
1 2
|
if (arr2[0] >= del)
cout << arr2[0] << endl;
|
And the rest of the if statements would be the same.
The "i" you are using here comes from line 24 which is set to (0) zero and never changes unless I missed something. If you are thinking that you are using the "i" from the for loop you are not. That "i" was destroyed when the for loop ended.
Some things to consider to shorten your code and make it easier to work with.
Andy