Arithmetic operation preliminary _064121 Vanguard Composire Technique

Source: Internet
Author: User

  This arithmetic function is limited, only two numbers of subtraction Four operations, can show the results of the simplest scores, but can not be converted into integers, such as a fraction of the integer, such as 6/3, and finally displayed as 2/1.

The code type is C + +, on the tip of the web, referring to the operator overloaded operator this technique, I do not know this knowledge point.

The process of fractional simplification is also referencing other resources, and then reading and understanding them carefully, with examples annotated next to them.

The compilation platform is compiled on the Mac OS system Xcode, and is compiled on non-VC + + platforms for the first time.

  Code:

Results:


1. Two true fractions, 1/2 and 1/3, subtraction results.

2. A non-minimal true fraction of 4/6, a false fraction that can be converted to integers 12/6, subtraction results.

        

3. Two false fractions, 4/2 and 9/3, which can be converted to integers, but the final result is displayed as fractions instead of integers .

        

Temporarily is the above function, "multiple operators + parentheses", "Determine the user answer correct error", "batch calculation of more than 100 questions" these features have not been completed, the next 3 weeks continue to improve.

Arithmetic operation preliminary _064121 Vanguard Composire Technique

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.