Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. public class Plik {
  2.  
  3. public static void main(String[] args) {
  4. Plik plik = new Plik();
  5. plik.quest();
  6. }
  7.  
  8. public void quest() {
  9. for(int a=1; a<=1000; a++) {
  10. for(int b=1; b<=1000; b++) {
  11. for(int c=1; c<=1000; c++) {
  12. for(int d=1; d<=1000; d++) {
  13. if(cube(a)+cube(b) == cube(c) + cube(d)) {
  14. System.out.println("a="+a+" b="+b+" c="+c+" d="+d);
  15. }
  16. }
  17. }
  18. }
  19. }
  20. }
  21.  
  22. public int cube(int n) {
  23. return n*n*n;
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement