1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
public class discord2 {
static float vc;
public static void main(String[]args){
float c[][]=new float[7][5];
float w=0;
float [][] perf=new float[7][5];
perf[0]=new float[]{120f,284f,5f,3.5f,18f};
perf[1]=new float[]{150f,269f,2f,4.5f,24f};
perf[2]=new float[]{100f,413f,4f,5.5f,17f};
perf[3]=new float[]{60f,596f,6f,8f,20f};
perf[4]=new float[]{30f,1321f,8f,7.5f,16f};
perf[5]=new float[]{80f,734f,5f,4f,21f};
perf[6]=new float[]{45f,982f,7f,8.5f,13f};
System.out.println(" la table de performance : ");
System.out.println("*****************************");
for (int i=0;i<7;i++){
for (int j=0;j<5;j++){
System.out.print (perf[i][j]+" ");
}
System.out.println();
}
for(int k=0;k<7;k++){
for(int h=0; h<7;h++){
int[] x={0,1};
for(int l:x){
if (h==k){w=666;}
else if (perf[h][l]<=perf[k][l]){
w=-(perf[h][l]-perf[k][l]);
}else w=0;
vc=w;
c[h][l]=vc;
vc=0;
}
int[]z={2,3,4};
for(int l:z){
if (h==k){w=666;}
else if(perf[h][l]>=perf[k][l]){
w=perf[h][l]-perf[k][l];
}
else w=0;
vc=w;
c[h][l]=vc;
vc=0;
}
}
for(int u=0; u<7;u++){
for(int x=0; x<5;x++){
System.out.print(c[u][x]+" ");
}
System.out.println();
}
System.out.println("\n");
}
}
} |
Partager