class Somas7 {
public static void main
(String[] args
) { int[] histograma = new int[100];
for (int a = 1; a < 7; a++) {
for (int b = 1; b < 7; b++) {
histograma[7 * (a + b + 1)]++;
}
}
int maior = 0;
for (int i : histograma) {
if (i > maior) maior = i;
}
for (int j = 0; j < 100; j++) {
if (histograma[j] == 0) continue;
System.
out.
println(j
+ "=" + histograma
[j
] + (histograma
[j
] == maior
? "*" : "")); }
}
}
Y2xhc3MgU29tYXM3IHsKICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZ1tdIGFyZ3MpIHsKICAgICAgICBpbnRbXSBoaXN0b2dyYW1hID0gbmV3IGludFsxMDBdOwogICAgICAgIGZvciAoaW50IGEgPSAxOyBhIDwgNzsgYSsrKSB7CiAgICAgICAgICAgIGZvciAoaW50IGIgPSAxOyBiIDwgNzsgYisrKSB7CiAgICAgICAgICAgIAloaXN0b2dyYW1hWzcgKiAoYSArIGIgKyAxKV0rKzsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBpbnQgbWFpb3IgPSAwOwogICAgICAgIGZvciAoaW50IGkgOiBoaXN0b2dyYW1hKSB7CiAgICAgICAgICAgIGlmIChpID4gbWFpb3IpIG1haW9yID0gaTsKICAgICAgICB9CiAgICAgICAgZm9yIChpbnQgaiA9IDA7IGogPCAxMDA7IGorKykgewogICAgICAgICAgICBpZiAoaGlzdG9ncmFtYVtqXSA9PSAwKSBjb250aW51ZTsKICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKGogKyAiPSIgKyBoaXN0b2dyYW1hW2pdICsgKGhpc3RvZ3JhbWFbal0gPT0gbWFpb3IgPyAiKiIgOiAiIikpOwogICAgICAgIH0KICAgIH0KfQ==