From ease to difficulty in Writing C ++ programs, (5) Problem: Implement random integer generation class randcreater that meets various requirements

Source: Internet
Author: User

In question (3), it is still complicated to solve the problem of random number generation. Of course, it is relatively simple to generate a common integer, but sometimes it is not just necessary. The following requirements are implemented to define some interfaces for this class. Currently, only all generated integers are required.

1. randcreater (int I) ranges from 0 ~ Within the I range

2, randcreater (int I, Int J) in I ~ Within J

3. randcreater (largeint linta) ranges from 0 ~ For the significance of largeint within the ivec range, see question (4)

4. randcreater (largeint linta, largeint lintb) in linta ~ Within the lintb range

5. There are two forms of the generated Number: (1) it can be a built-in int type, (2) it can also generate the largeint defined in (4.

The tentative interface is not suitable for modification.

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.