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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
#include <iostream>
using namespace std;
const int n = 3;
void firstchange(int a[n][n], int n)
{
for(int i = 0; i<n; i++)
for(int j = 0; j<n; j++)
{
int temp = (a[i][j]) * 7;
a[i][j] = temp;
}
}
void secondchange(int b[n][n], int n)
{
for(int i=0; i<n; i++)
for(int j=0; j<n; j++)
{
int temp = (b[i][j]) +5;
b[i][j]= temp;
}
}
int main()
{
int FirstArray[n][n] = {1,2,3,4,5,6,7,8,9};
int SecondArray[n][n] = {1,2,3,4,5,6,7,8,9};
firstchange(FirstArray,n);
secondchange(SecondArray,n);
for(int i=0; i<n; i++)
{
for(int j=0; j<n; j++)
{
cout<<FirstArray[i][j]<<" ";
}
cout<<endl;
}
std::cout << "2nd " << std::endl;
for(int i=0; i<n; i++)
{
for(int j=0; j<n; j++)
{
cout<<SecondArray[i][j]<<" ";
}
cout<<endl;
}
int x;
cin >> x;
return 0;
}
|