dimuster

166500333

Jan 12th, 2021 (edited)
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <vector>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8.     double c;
  9.     int b;
  10.     vector <int> a;
  11.     for (int i = 100; i <= 1000; i++) {
  12.         for (int j = 100; j <= 1000; j++) {
  13.             for (int k = 100; k <= 1000; k++) {
  14.                 c = pow(i, 3) + pow(j, 3) + pow(k, 3);
  15.                 b = (int)c;
  16.                 if (c == i * 1000000 + j * 1000 + k)
  17.                     a.push_back(c);
  18.             }
  19.         }
  20.     }
  21.     for (int i : a) {
  22.         cout << i << endl;
  23.     }
  24.     return 0;
  25. }
Add Comment
Please, Sign In to add comment