[Q] What are the questions about train arrival?

Source: Internet
Author: User

1.A railway station has two trains passing by, one heading south every 10 minutes, and the other heading north every 10 minutes. James needs to take the train to work every day, he has a car whenever he arrives (Anytime ). After taking the train for a year, James calculated why 91% of trains are sent to Nankai. Why? Have you ever encountered this kind of problem? Please kindly advise!

2.

An Algorithm about the number of squares? A rectangle with a height of 4 and 6 and each small square is a square. How many squares can be found at most?
           
           
           
           

 

 

 

 

A:

1 .?

2 In the gardenOpenorzWith the help of this renxiong, how can I export this n * (N + 2) formula? Use code to indicate yes

 1 public int SquareSum(int SquareWidth)
2 {
3 int Sum=0;
4 if(SquareWidth!=null && SquareWidth!=0)
5 {
6 for(int i=0;i<SquareWidth;i++)
7 {
8 Sum+=SquareWidth*(SquareWidth+2);
9 }
10 }
11 retutn Sum;
12 }

If the final result is obtained, you only need to set the width to 4 and pass in the parameter.

PS: thank you too.OpenorzBrother, freedom, sharing, and communication. I think this is what the blog Park advocates.

Author: lonely_rain
Exit: http://www.cnblogs.com/lonely_rain/
Personal site: http://www.thinkeer.com/
You are welcome to reprint it in any form, but be sure to indicate the source.

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.