Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Plik {
- public static void main(String[] args) {
- Plik plik = new Plik();
- plik.quest();
- }
- public void quest() {
- for(int a=1; a<=1000; a++) {
- for(int b=1; b<=1000; b++) {
- for(int c=1; c<=1000; c++) {
- for(int d=1; d<=1000; d++) {
- if(cube(a)+cube(b) == cube(c) + cube(d)) {
- System.out.println("a="+a+" b="+b+" c="+c+" d="+d);
- }
- }
- }
- }
- }
- }
- public int cube(int n) {
- return n*n*n;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement