Questions for Stamp collectors C + + language code

Source: Internet
Author: User

Stamp collectors store all the stamps in 3 philatelic albums, store all 2/10 in book A, store all seven per cent in book B, store 303 stamps in volume C, ask the total number of stamp collectors for this collector, and how many stamps are stored in each booklet?

The programming steps are as follows:

    1. To create a console application
    2. Application header File
    3. Define A,B,C,X and sum as basic integral types
    4. The value of x is tested to meet the X value of 106050% (28-5*x) ==0, which is calculated by calculating the total number of stamps and the quantity of stamps in each album. (x stands for all seven x in book B)
    5. The main code of the program is as follows:
1#include <iostream>2 using namespacestd;3 4 voidMain ()5 {6     inta,b,c,x,sum;7      for(x=1; x<=5; x + +)8     {9         if(10605%( --5*x) = =0)Ten         { Onesum=10605/( --5*X);//set seven X ((X/7) + (1/5)) =303/sum; AA=2*sum/Ten; -b=x*sum/7; -C=303; theprintf"Total is %d\n", sum); -printf"A:%d\n", a); -printf"b:%d\n", b); -printf"c:%d\n", c); +         } -     } +}

The results of the operation are as follows:

Issues with stamp collectors for the C + + language code

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.