anonymous No title
No License Java
2019年10月14日
Copy Clone
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package repo6.pkg3;

/**
 *
 * @author g1972100
 */
public class Repo63 {

    public static void main(String argv[]) {

        //70kg=X君,60kg=Y君,30kg=Z君,20kg=W君とする
        int x=70,y=60,z=30,w=20;
        int res;    //result
        int px,py,pz,pw;    //power=distance*heavy
        
        for(int i=-3;i<=3;i++){
            px=x*i;
            for(int j=-3;j<=3;j++){
                py=y*j;
                for(int k=-3;k<=3;k++){
                    pz=z*k;
                    for(int l=-3;l<=3;l++){
                        pw=w*l;
                        res=px+py+pz+pw;
                        if(res==0){
                            if(((i!=j)&&(i!=k)&&(i!=l)&&(j!=k)&&(j!=l)&&(k!=l))&&((i!=0)&&(j!=0)&&(k!=0)&&(l!=0))){
                                System.out.println("X=" + i +" Y=" + j+" Z=" + k+" W=" + l + " (-3=A,-2=B-1=C,1=D,2=E,3=Fを指します)");                             
                            }
                        }
                    }
                }
            }
        }
    }
}
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package repo6.pkg3;

/**
 *
 * @author g1972100
 */
public class Repo63 {

    public static void main(String argv[]) {

        //70kg=X君,60kg=Y君,30kg=Z君,20kg=W君とする
        int x=70,y=60,z=30,w=20;
        int res;    //result
        int px,py,pz,pw;    //power=distance*heavy
        
        for(int i=-3;i<=3;i++){
            px=x*i;
            for(int j=-3;j<=3;j++){
                py=y*j;
                for(int k=-3;k<=3;k++){
                    pz=z*k;
                    for(int l=-3;l<=3;l++){
                        pw=w*l;
                        res=px+py+pz+pw;
                        if(res==0){
                            if(((i!=j)&&(i!=k)&&(i!=l)&&(j!=k)&&(j!=l)&&(k!=l))&&((i!=0)&&(j!=0)&&(k!=0)&&(l!=0))){
                                System.out.println("X=" + i +" Y=" + j+" Z=" + k+" W=" + l + " (-3=A,-2=B-1=C,1=D,2=E,3=Fを指します)");                             
                            }
                        }
                    }
                }
            }
        }
    }
}
No one still commented. Please first comment.