[Questions of the Blue Bridge Cup] questions of Euler's, eggs, and Blue Bridge

Source: Internet
Author: User

[Questions of the Blue Bridge Cup] questions of Euler's, eggs, and Blue Bridge

The great mathematician Euler met two rural women in the village at the fair, each carrying an empty basket. They greeted Euler and said they had just sold all the eggs.

Euler casually asked: "How many eggs are sold ?"

Unexpectedly, they said, "The two of us sold our own eggs. They sold a total of 150 eggs. Although we sold a lot of eggs, we just got the same amount of money. You can guess !"

Euler cannot guess.

Another added: "If I sell at that price, I will get 32 yuan. If I sell at my price, I will get 24.5 yuan ".

Euler thought and gave the correct answer.

 

We are not mathematicians, so we are too reluctant to list formulas for analysis. However, a computer can "brute-force cracking", that is, to test all possible conditions, until it hits!

Write the number of eggs per person (unlimited order), separated by commas.

 

The answer is written in dig into. txt. Do not write it here!

 

Reference answer:

70, 80 or 80, 70

 

Experience: At first, I thought I could get 32 or 24.5 for selling them together.

Then calculate the numbers 0 and 150, and output some strange numbers. But finally, it's right.

1 # include <stdio. h> 2 int main (void) 3 {4 int I; 5 int j; 6 for (I = 1; I <150; I ++) 7 for (j = 1; j <150; j ++) 8 {9 if (I * (32.0/(150-i) = (j * (24.5/(150-j )))) printf ("% d, % d", I, j); 10} 11 return 0; 12}

 

Related Article

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.