07/06/21 17:02:37
>>449
public class A {
public static void main(String[] args) {
String[] teams = new String[]{"A","B","C","D"};
int games = 0;
for (int i=0; i<teams.length; i++) {
for (int j=i+1; j<teams.length; j++) {
System.out.println(teams[i] + " vs " + teams[j]);
games++;
}
}
System.out.println( (teams.length * (teams.length-1) / 2) +"games");
System.out.println( games +"games");
}
}