Program 18 Topic: Two table tennis teams, each with three people. Team A consists of three people: A, B and C, while Team B consists of three people: X, Y, Z, Y and Z. The name of the competition has been decided by drawing lots.
* @param args
*
* Title: Two Ping-pong balls
* There are three players from each team. first
* Team A, Team B, Team C, Team B is X, Y, Z, Y, Z ... The competition list is decided by drawing lots.
Someone asked the players about the list of matches.
* a says he won't compete with X, and C says he won't compete with X and Z. Please make a program to find out the names of the three teams.
*/
Public static void main(String[] args) {
// TODO automatically generated method stub
String []A ={"a "," b "," c " };
String [] B={"x "," y "," z " };
String[]C = new string [3];
for(int I = 0; I<b. Length; i++){
If ((! B[i]。 equals(" x "))& amp; & amp(! B[i]。 equals(" z ")){
c[2]= B[I];
Continue;
}else if(! B[i]。 Equal to ("x "){
c[0]= B[I];
Continue;
} Otherwise {
c[ 1]= B[I];
}
}
for(int I = 0; I<c. Length; i++){
system . out . println(A[I]+" VS "+C[I]);
}
}
}