#include <iostream>
using namespace std;
int a[4][4] = {
{2, 8, 0, 4},
{1, 7, 4, 7},
{2, 2, 5, 4},
{6, 1, 6, 8}
};
int b[4][4] = {
{7, 9, 9, 7},
{5, 6, 0, 0},
{6, 6, 9, 2},
{7, 8, 5, 4}
};
void abb(int ee, int ss)
{
int aa = 0;
int count = 4;
for (int i = 0; i < count; i++)
{
for (int j = 0; j < count; j++)
{
for (int ii = 0; ii < count; ii++)
{
for (int jj = 0; jj < count; jj++)
{
if ((a[i][j] + a[3][jj]) % 10 == ee && (b[i][j] + b[3][jj]) % 10 == ss)
{
for (int z = 0; z < count; z++)
{
for (int x = 0; x < count; x++)
{
if (i == z && j == x)
{
cout << "(";
}
if (3 == z && jj == x)
{
cout << "(";
}
if (i == 3 && j == jj)
{
continue;
}
cout << a[z][x] << "\t";
}
cout << endl;
}
cout << "_________________________" << endl;
}
}
}
}
}
}
void abb1(int ee, int ss)
{
int count = 4;
for (int i = 0; i < count; i++)
{
for (int j = 0; j < count; j++)
{
for (int ii = 0; ii < count; ii++)
{
for (int jj = 0; jj < count; jj++)
{
if ((a[i][j] + a[ii][jj] + a[3][jj]) % 10 == ee
&& (b[i][j] + b[ii][jj] + b[3][jj]) % 10 == ss)
{
for (int z = 0; z < count; z++)
{
for (int x = 0; x < count; x++)
{
if (i == z && j == x)
{
cout << "(";
}
if (ii == z && jj == x)
{
cout << "(";
}
if (z == 3 && jj == x)
{
cout << "(";
}
cout << a[z][x] << "\t";
}
cout << endl;
}
cout << "_________________________" << endl;
}
}
}
}
}
}
int main(int argc, char **argv)
{
int n = 1;
while (n)
{
int ee = 0;
int ss = 0;
cout << "输入要找的规律" << endl;
cin >> ee;
cout << "输入" << endl;
cin >> ss;
abb(ee, ss);
abb1(ee, ss);
}
return 0;
}
using namespace std;
int a[4][4] = {
{2, 8, 0, 4},
{1, 7, 4, 7},
{2, 2, 5, 4},
{6, 1, 6, 8}
};
int b[4][4] = {
{7, 9, 9, 7},
{5, 6, 0, 0},
{6, 6, 9, 2},
{7, 8, 5, 4}
};
void abb(int ee, int ss)
{
int aa = 0;
int count = 4;
for (int i = 0; i < count; i++)
{
for (int j = 0; j < count; j++)
{
for (int ii = 0; ii < count; ii++)
{
for (int jj = 0; jj < count; jj++)
{
if ((a[i][j] + a[3][jj]) % 10 == ee && (b[i][j] + b[3][jj]) % 10 == ss)
{
for (int z = 0; z < count; z++)
{
for (int x = 0; x < count; x++)
{
if (i == z && j == x)
{
cout << "(";
}
if (3 == z && jj == x)
{
cout << "(";
}
if (i == 3 && j == jj)
{
continue;
}
cout << a[z][x] << "\t";
}
cout << endl;
}
cout << "_________________________" << endl;
}
}
}
}
}
}
void abb1(int ee, int ss)
{
int count = 4;
for (int i = 0; i < count; i++)
{
for (int j = 0; j < count; j++)
{
for (int ii = 0; ii < count; ii++)
{
for (int jj = 0; jj < count; jj++)
{
if ((a[i][j] + a[ii][jj] + a[3][jj]) % 10 == ee
&& (b[i][j] + b[ii][jj] + b[3][jj]) % 10 == ss)
{
for (int z = 0; z < count; z++)
{
for (int x = 0; x < count; x++)
{
if (i == z && j == x)
{
cout << "(";
}
if (ii == z && jj == x)
{
cout << "(";
}
if (z == 3 && jj == x)
{
cout << "(";
}
cout << a[z][x] << "\t";
}
cout << endl;
}
cout << "_________________________" << endl;
}
}
}
}
}
}
int main(int argc, char **argv)
{
int n = 1;
while (n)
{
int ee = 0;
int ss = 0;
cout << "输入要找的规律" << endl;
cin >> ee;
cout << "输入" << endl;
cin >> ss;
abb(ee, ss);
abb1(ee, ss);
}
return 0;
}