Tag: sys Char Har decides else STR class program nbsp
Two table tennis teams competed, each of three people. Team A for A,b,c three, team B for the x, Y, z three, with lots to decide the contest list. Someone asked the team about the game list: A said he did not compare with X, C said he did not and X, Z ratio. Please compile the procedure to find out the list of the three teams.
public class Example18 {
public static void Main (string[] args) {
VS ();
}
public static void Vs () {
Char[] m = {' A ', ' B ', ' C '};
Char[] n = {' x ', ' y ', ' z '};
for (int i = 0; i < m.length; i++) {
for (int j = 0; J < N.length; J + +) {
if (m[i] = = ' A ' && n[j] = = ' x ') {
Continue
} else if (m[i] = = ' A ' && n[j] = = ' Y ') {
Continue
} else if ((m[i] = = ' C ' && n[j] = = ' x ')
|| (M[i] = = ' C ' && n[j] = = ' Z ')) {
Continue
} else if ((m[i] = = ' B ' && n[j] = = ' Z ')
|| (M[i] = = ' B ' && n[j] = = ' Y ')) {
Continue
} else {
System.out.println (M[i] + "vs" + n[j]);
}
}
}
}
}
Java Classic Programming question 50-way 18