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
|
#include <cstdlib>
#include <iostream>
using namespace std;
int addArray(int [][2], int[][2], int, int);
int main(int argc, char** argv) {
int array1 [3][3]={{1,2,5},
{3,4,5}};
int array2[3][3]={{5,6,6},
{7,8,6}};
int position1, n;
int position2, a;
cout<<"Enter a position";cin>>position1;
cout<<"Enter a position";cin>>position2;
cout<<addArray(array1[n][2],array2[a][2], position1, position2);
return 0;
}
int addArray(int one[][2], int two[][2], int n, int a)
{
int add;
add=one[n][2]+two[a][2];
return add;
}
|