Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <vector>
- using namespace std;
- int main() {
- double c;
- int b;
- vector <int> a;
- for (int i = 100; i <= 1000; i++) {
- for (int j = 100; j <= 1000; j++) {
- for (int k = 100; k <= 1000; k++) {
- c = pow(i, 3) + pow(j, 3) + pow(k, 3);
- b = (int)c;
- if (c == i * 1000000 + j * 1000 + k)
- a.push_back(c);
- }
- }
- }
- for (int i : a) {
- cout << i << endl;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment