include iostream using namespace std int main double array 10 array2 m

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <iostream>
using namespace std;
int main() {
double array[10], array2[4][4], max[2] = {0, 0};
int i, j;
cout << "input array[10]" << endl;
for(i = 0; i < 10; ++i) {
cin >> array[i];
}
cout << "input array[4][4]" << endl;
for(i = 0; i < 4; ++i) {
for(j = 0; j < 4; ++j) {
cin >> array2[i][j];
}
}
for(i = 0; i < 10; ++i) {
if(abs(array[i]) > max[0]) max[0] = abs(array[i]);
}
for(i = 0; i < 4; ++i) {
for(j = 0; j < 4; ++j) {
if(abs(array2[i][j]) > max[1]) max[1] = abs(array2[i][j]);
}
}
cout << "biggest value in array[10] => " << max[0] << endl << "biggest value in array[4][4] => " << max[1] << std::endl;
return 0;
}