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
|
#include <iostream>
#include <sstream>
#include <algorithm>
#include <vector>
#include <random>
#include <chrono>
using namespace std;
int main() {
int myints[] = { 5, 6, 7, 8, 9, 0, 1, 2, 3 };
int two[] = { 1, 2, 3, 5, 6, 7, 8, 9, 0 };
int num = 1;
string numString;
int numList[] = { 0 };
int counter = 0;
int mult = 0;
int zero = 0;
string numTemp;
do {
stringstream buffer;
buffer << myints[0] << ' ' << myints[1] << ' ' << myints[2] << ' ' << myints[3] << ' ' << myints[4] << ' ' << myints[5] << ' ' << myints[6] << ' ' << myints[7] << ' ' << myints[8] << '\n';
cout << buffer.str();
numString = buffer.str();
num = stoi(numString);
if (zero = num % 2) {
do {
numList[counter] = (num / (10 ^ counter) % 10);
counter += 1;
} while (counter != 9);
do {
num *= 2;
mult += 1;
numTemp = to_string(num);
if (numTemp.find(1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 != std::string::npos)) {
cout << "Success" << ' ' << num << " x2^" << mult;
return 0;
}
} while (num < 10000000000);
}
} while (std::next_permutation(myints, myints + 9));
return 0;
}
|