fork download
  1. class Somas7 {
  2. public static void main(String[] args) {
  3. int[] histograma = new int[100];
  4. for (int a = 1; a < 7; a++) {
  5. for (int b = 1; b < 7; b++) {
  6. histograma[7 * (a + b + 1)]++;
  7. }
  8. }
  9. int maior = 0;
  10. for (int i : histograma) {
  11. if (i > maior) maior = i;
  12. }
  13. for (int j = 0; j < 100; j++) {
  14. if (histograma[j] == 0) continue;
  15. System.out.println(j + "=" + histograma[j] + (histograma[j] == maior ? "*" : ""));
  16. }
  17. }
  18. }
Success #stdin #stdout 0.04s 4386816KB
stdin
Standard input is empty
stdout
21=1
28=2
35=3
42=4
49=5
56=6*
63=5
70=4
77=3
84=2
91=1