. NET development interesting topic two

Source: Internet
Author: User

One, a monthly salary tens of thousands of net developer issues:

There was a troop length of 100 meters, a uniform advance, a runner with a constant speed from the team head movement to the team tail, then returned the team head, in which the troops marched 100 meters, asking the runner the distance of the movement.

Suppose it took 100 seconds, and the team's speed was 1; V for the runner speed, the distance from the runner to the tail of the team is S. Then a total of M + 2 * S is gone.

The Herald goes to S, then the troops walk 100-s, the Herald to the tail.

Go forward, the distance for 100+s, and the troops just walked 100-s, then when walking 100-(100-s) = S time the same. Then there are

S/(100+s) = (100-s)/s
=> s^2 = 10000-s^2
=> s^2 = 5000;
=> S = 70.71067811865475244008443621049
=>close

The root function is available in the math namespace. You can also iterate over them.

Second, the monthly salary of 50,000, Microsoft China Institute of the latest interview questions, Xiao Ming and Xiao Qiang are Zhang teacher's students, Zhang teacher's birthday is M month n days, 2 people know Zhang Teacher's birthday is the following 10 group of one day, Zhang teacher told the M value of Xiao Ming, the N value told the small, Zhang teacher asked them know his birthday is that day?

March 4 March 5 March 8
June 4 June 7
September 1 September 5
December 1 December 2 December 8

Xiaoming said: "If I do not know, Xiao Qiang must not know
Xiao Qiang said: I do not know, but now I know
Xiao Ming said: Oh, then I also know

Please infer from the above dialogue which day is Mr. Zhang's birthday

Reason:

1. Xiao Ming said: If I do not know, Xiao Qiang certainly did not know, then: June 7 and December 2 was removed
2. Xiaoming said: If I do not know, Xiao Qiang must not know + Xiao Qiang said: I do not know, but now I know then: only June 4 is the only confirmed

From the above questions can be seen: really good at writing code people tend to jump into the code to amuse themselves without self-knowledge, but forget to think about the nature of the problem, this may be the best programmers and so-called professional programmers the biggest difference.



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.