The mathematical question Huang Rong gave to his aunt

Source: Internet
Author: User
I don't know the number of things today. There are only two to three, three to five, and three to seven?

Jie Gu's C # solution: using system;
Using system. Collections. Generic;
Using system. text;

Namespace SS
...{
Class Program
...{
Static void main (string [] ARGs)
...{
Int I = 0;
While (true)
...{
I ++;
If (I % 3 = 2 & I % 5 = 3 & I % 7 = 2)
...{
Console. writeline (I );
}
}
}
}
}

 
Huang Rong solution:
Huang Rong smiled and said, "This is easy. Multiply the remainder by 70, the remainder by 21, and the remainder by fifteen. If they are not greater than one hundred and five, they are the number of answers. Otherwise, they must be reduced to one hundred and five or a multiple ." I figured it out in my heart, and it was really good. I whispered, "three or three numbers, the remainder multiplied by 70; five or five numbers ......" Huang Rong said: "You don't need to remember this. If I read a poem for you, it's easy to remember: three people walk 70 thin, five trees have one plum blossom, and the seven sons have been reunited for half a month, you will know about it in the hundreds or even five years."
Huang Rong's C # solution:
What does triplicate mean? I do the remainder of 3, but the result is incorrect.

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.