#import<Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
for(int i=100;i<1000;i++){
int g = i/100;
int s = (i-(i/100)*100)/10;
int b = i - g*100-s*10;
int result = g*g*g+s*s*s+b*b*b;
if(i==result){
NSLog(@"%d",i );
}
}
}
return 0;
}
|
|