/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
public static int obterPosicao
(String equipe
){ switch (equipe){
case "Alemanha": return 0;
case "Irlanda": return 1;
case "Polonia": return 2;
case "Escocia": return 3;
}
return -1;
}
public static void main
(String[] args
) { {"Alemanha","2","Escocia","1"},
{"Polonia","2","Alemanha","0"},
{"Alemanha","1","Irlanda","1"},
{"Polonia","2","Escocia","2"},
{"Escocia","1","Irlanda","0"},
{"Irlanda","1","Polonia","1"},
{"Irlanda","1","Escocia","1"},
{"Alemanha","3","Polonia","1"},
{"Escocia","2","Alemanha","3"},
{"Irlanda","1","Alemanha","0"},
{"Escocia","2","Polonia","2"},
{"Polonia","2","Irlanda","1"}
};
int[] pontuacoes = new int[4];
String[] nomes
= {"Alemanha",
"Irlanda",
"Polonia",
"Escocia"};
for (int i = 0; i < resultados.length; ++i){
int golos1
= Integer.
parseInt(resultados
[i
][1]); int golos2
= Integer.
parseInt(resultados
[i
][3]);
int score1 = 1, score2 = 1;
if (golos1 > golos2){
score1 = 3;
score2 = 0;
}
else if (golos1 < golos2){
score1 = 0;
score2 = 3;
}
pontuacoes[obterPosicao(resultados[i][0])] += score1;
pontuacoes[obterPosicao(resultados[i][2])] += score2;
}
for (int i = 0; i < pontuacoes.length; ++i){
System.
out.
println("Pontuação para " + nomes
[i
] + " é " + pontuacoes
[i
]); }
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgaW50IG9idGVyUG9z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