Java Classic Programming question 50-way 18

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.