2037 data maker

Source: Internet
Author: User

 

Description

Before LCL was promoted to the sophomore year, I heard that physical experiments are a headache. So now, LCL, which is already a sophomore year, is struggling and causing headaches ......
TT said well ~ "The experiment is well done ~ It's not as good as data compilation. "When LCL finds that the final error in the computation of the data it has made is greater than 100%, it is unfortunate that it has crashed ......
So and LCL decide to compile the data! However, because she has collapsed, there is no way to compile data for herself. This historic task once again falls on your shoulders ~ However, the reason why physical experiments are entangled is that their data is not so well compiled and there are many trivial requirements, such as the data requirements within a certain range, such as the number of decimal places required for data retention.

To simplify your work, LCL only requires you to write the key statements that generate the data. To ensure that the data looks real enough, these key statements must be written using random functions.

A random integer can be generated by simply using rand (). How can we control the range of random numbers? How to generate a random real number? For details, see the example ~

/*
Digress:
1. The random function is included in the header file <ctime>.

2. In actual use, to ensure true randomization, srand (Time (null) must be added. For statements, see the teaching material.

3. You will be able to randomly generate data to test your ownProgramLa ~ LCL data is very lazy. =

*/

Input

the input includes multiple groups of data.

each group of data contains a character X, which indicates whether to generate an integer (d) or a real number (f); three integers A, B, and C, A indicates the number of digits retained after the decimal point. If an integer is generated, A defaults to 0. B and C indicate the upper and lower limits of the generated random number (the random number can be equal to B or C ). Each group of data occupies one row. (0 <= A <= 5; 0 <= B <= C <= 10000)

Output

for each group of data, the corresponding random function format is output in each row. For details, see the sample.

sample input
F 2 9357 9394
D 0 7511 9846
F 4 8642 9576
sample output
(RAND () % 939400 + 935700)/POW (10, 2)
rand () % 2336 + 7511
(RAND () % 95760000 + 86420000)/POW (10, 4)

simple simulation

 # include 
    
      int main () {char a [2]; int I; int num1, num2, num3; while (scanf ("% s", & )! = EOF) {scanf ("% d", & num1, & num2, & num3); if (a [0] = 'F ') {printf ("(RAND () % d", num3); for (I = 0; I 
     

      

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.