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.

22 lines
273 B

#include<bits/stdc++.h>
using namespace std;
int main() {
int i,m,k;
int a[3];
for(i=100; i<1000; i++) {
m=i;
k=0;
while(m) {
a[k]=m%10;
m=m/10;
k++;
}
if(i==(a[0]*a[0]*a[0]+a[1]*a[1]*a[1]+a[2]*a[2]*a[2])) {
printf("%d\n",i);
}
}
return 0;
}