You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
326 B

#include <bits/stdc++.h>
using namespace std;
int main() {
for (int i = 100; i <= 999; i++) {
int sum = 0;
int n = i;
while (n) {
int x = n % 10;
n /= 10;
sum += x * x * x;
}
if (sum == i) cout << i << " ";
}
return 0;
}