(If you are interested, come in and have a look.) an intellectual programming question

Source: Internet
Author: User
Question:
There are four people A, B, C, and D. They each say two sentences:
A said:
1) I arrived by one digit before B (for example, if B arrives by the second digit, A is the first digit, the same below)
2) I did not arrive at the first place
B said:
1) I arrived before C.
2) I did not arrive in the second place
C:
1) I arrived before D.
2) I did not arrive in the third place.
D:
1) I arrived before
2) I did not arrive in the fourth place.

Among them: 1) only two sentences are true, but not necessarily those of the same person. The other six sentences are false;
2) The first person told the truth. (Is there only one truth, or are both true? Unknown)

The arrival sequence of the four persons A, B, C, and D.

Program code written: http://files.cnblogs.com/lxinxuan/ConsoleApplication1.rar

Program Description: Construct a fully-arranged array composed of a group of known numbers.

Revision history:
[20070831] If there is a problem with multiple solutions, of course this question only has a unique solution.

Welcome to test!

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.