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:
|
public class EA3 {
private final int[][] group = {
{1,1,0,1,1,1,1,1,1,0},
{1,0,1,1,0,1,1,0,0,0},
{0,1,1,0,1,1,0,1,0,0},
{1,1,0,1,1,0,1,0,0,1},
{0,1,0,0,1,1,0,1,0,0},
{1,1,0,1,1,0,1,0,0,0},
{0,1,0,0,1,1,0,0,0,0},
{1,1,0,0,0,0,1,0,0,0}
};
private final String[] classification =
{"E", "D", "R", "N", "EuR", "EuN", "ER", "En"};
public void auswertenPaar(int[] anfang, int[] ende, int i, int j) {
int sum = 0;
for (int h = 0; h < 10; h++) {
if ((anfang[h] == 1) && (ende[h] == 1)) {
sum++;
}
}
if (i >= classification.length || j >= classification.length)
System.exit(0);
double op = sum / 10.0;
if (op >= 0.4) {
System.out.println("Das Paar " + classification[i] + " " + classification[j] + " hat Wert: " + op);
}
}
public void auswerten() {
for (int i = 0; i < group.length; i++) {
for (int j = i + 1; j < group.length; j++) {
auswertenPaar(group[i], group[j], i, j);
}
}
}
public static void main(String[] args) {
EA3 ea3 = new EA3();
ea3.auswerten();
}
} |