Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     for (int t = 0; t < 10; t++)
  8.     {
  9.         for (int o = 0; o < 10; o++)
  10.         {
  11.             if (o == t)
  12.                 continue;                               // Skip this number then
  13.             for (int g = 0; g < 10; g++)
  14.             {
  15.                 if (g == t || g == o)
  16.                     continue;                           // Skip this number then
  17.                 for (int d = 0; d < 10; d++)
  18.                 {
  19.                     if (d == g || d == t || d == o)
  20.                         continue;                       // Skip this number then
  21.  
  22.                     int too = t * 100 + o * 10 + o;
  23.                     int good = g * 1000 + o * 100 + o * 10 + d;
  24.  
  25.                     if (too * 4 == good)
  26.                     {
  27.                         cout << "TOO = " << too << endl;
  28.                         cout << "GOOD = " << good << endl;
  29.                     }
  30.                 }
  31.             }
  32.         }
  33.     }
  34.     return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement