Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- ofstream fout("bac.out");
- int main()
- {
- unsigned int p1, p2;
- cin >> p1 >> p2;
- int nr = 0;
- int v[7];
- for(int i = 9; i > 0; i--)
- {
- if(p1 % i == 0)
- {
- int c1 = i;
- int c2 = p1 / i;
- if(c2 < 10)
- {
- v[0] = c1;
- v[1] = c2;
- for(int k = 9; k >= 0; k--) {
- for (int j = 9; j > 0; j--) {
- if (p2 % j == 0) {
- int c1 = j;
- int c2 = p2 / j;
- if (c2 < 10) {
- v[2] = k;
- v[3] = k;
- v[4] = k;
- v[5] = c1;
- v[6] = c2;
- cout << v[0] << v[1] << v[2] << v[3] << v[4] << v[5] << v[6] << "\n";
- }
- }
- }
- }
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement