Arithmetic Upgrade class Ideas

Source: Internet
Author: User

1, the problem to avoid repetition in the output is to determine whether random numbers and random symbols are all the same. All the same then break;
2, custom, M for custom number of copies, n to customize the number of questions per title

for (j=0;j<m;j++)
{
for (i<0;i<n;i++)
{
A=rand ()%100; Generates 100 or less random numbers
B=rand ()%100;
D=rand ()%4; Generating random operators
Switch (d)
{
Case 0:
cout<<a<< "+" <<b<< "=" <<endl;
Break
Case 1:
cout<<a<< "-" <<b<< "=" <<endl;

Break
Case 2:
cout<<a<< "*" <<b<< "=" <<endl;
Break
Case 3:
cout<<a<< "/" <<b<< "=" <<endl;
Break

}
}
}

3, control parameters: whether there is a multiplication method, whether there are parentheses, the range of values, plus or minus negative numbers, Division has no number, whether to support fractions (true, false), whether to support fractional (accurate to how many bits)
The interval of each line in the print can be adjusted ....
Output selection Hint: Select the multiplication method. Plus minus have negative numbers
Select output, before output, judge whether the condition can be satisfied. Plus or minus a negative number to judge a>b, then output;

PS: Because some things forgot to upload, teacher, Beg pardon!!!!

Arithmetic Upgrade class Ideas

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.