Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- for (int t = 0; t < 10; t++)
- {
- for (int o = 0; o < 10; o++)
- {
- if (o == t)
- continue; // Skip this number then
- for (int g = 0; g < 10; g++)
- {
- if (g == t || g == o)
- continue; // Skip this number then
- for (int d = 0; d < 10; d++)
- {
- if (d == g || d == t || d == o)
- continue; // Skip this number then
- int too = t * 100 + o * 10 + o;
- int good = g * 1000 + o * 100 + o * 10 + d;
- if (too * 4 == good)
- {
- cout << "TOO = " << too << endl;
- cout << "GOOD = " << good << endl;
- }
- }
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement