Advertisement
Josif_tepe

Untitled

Nov 15th, 2024
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     for(int i = 100; i <= 999; i++) {
  6.         int z = i % 10;
  7.         int y = (i / 10) % 10;
  8.         int x = i / 100;
  9.        
  10.         if(y * y + z + x * x * x == i) {
  11.             printf("%d ", i);
  12.         }
  13.     }
  14.    
  15.     return 0;
  16. }
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement