Home > Back-end >  Elementary arithmetic test
Elementary arithmetic test

Time:11-11

(1) title for primary school students (respectively to +, -, *, present different operations), such as;
(2) students to review it after to solve the problem;
(3) students, after every do review it gives "the answer is correct, very good" or "the answer wrong, redo" and other words;
(4) add, subtract, multiply, divide function can freely choose to implement;
(5) can control numerical operations in two or within the scope of arithmetic (three digits),

CodePudding user response:

 # include & lt; Ctime>//For the time () 
#include //For srand () and rand ()
#include
#include

using namespace std;

Auto method ()
{
Int v1=abs (rand () % 10-6);//add 0 1 multiply 2 divide 3
Return v1.
}

Int main ()
{
Srand (time (NULL));


While (true)
{
Int v2=rand () % 100 + rand () % 100;//double-digit triple-digit random number
Int the v3=rand () % 100 + rand () % 100;//` `
If (method ()==0)
{
Int answer;
Cout & lt; Cin & gt;> answer;
If (answer==v2 and v3) {cout & lt; <"Correct answer" & lt; The else {cout & lt; <"Wrong answer" & lt; }
Else if (method ()==1 & amp; & V2 & gt; V3)
{
Cout & lt; Int answer;
Cin & gt;> answer;
If (answer==v2, v3) {cout & lt; <"Correct answer" & lt; The else {cout & lt; <"Wrong answer" & lt; }
Else if (method ()==2)
{
Cout & lt; Int answer;
Cin & gt;> answer;
If (answer==v2 * v3) {cout & lt; <"Correct answer" & lt; The else {cout & lt; <"Wrong answer" & lt; }
Else if (method ()==3 & amp; & V2 & gt; V3)
{
Cout & lt; Int answer;
Cin & gt;> answer;
If (answer==v2/v3) {cout & lt; <"Correct answer" & lt; The else {cout & lt; <"Wrong answer" & lt; }
The else
{
continue;
}
Sleep (300);
}
}


Thinking is the roughly, the rest of the need to adjust yourself looking at, is after all elementary school students?

CodePudding user response:

This is too good for my writing,
https://blog.csdn.net/weixin_44119517/article/details/88883956

CodePudding user response:

A look at his code indentation 8 don't want to see it, I only accept the indentation 2 g ~ ~ ~

CodePudding user response:

reference 3 floor early play play nuclear response:
a see his code indentation 8 don't want to see it, I only accept the indentation 2 g ~ ~ ~


There are too many nested? I usually set to 4,

CodePudding user response:


V0.9.2 added sound effects and background music,
In the code before v0.9.2 c:
The catch (... )//to catch (EConvertError & amp; E), so can only capture Edit1 - & gt; Text. ToInt ()
{//conversion error exception, avoid capture with code might throw other abnormal
ShowMessage (" please enter the number ");
}

CodePudding user response:

https://download.csdn.net/download/u010165006/9835443

CodePudding user response:

Ooolinux
reference 4 floor response:
Quote: refer to 3rd floor early play big play nuclear war reply:

A look at his code indentation 8 don't want to see it, I only accept the indentation 2 g ~ ~ ~


There are too many nested? I usually set to 4,


Indented 8 is a favorite of Linus Torvalds, he says the indentation 4, 2 person for pagan ~ ~ ~

CodePudding user response:

refer to 7th floor early play big play nuclear response:
Quote: refer to 4th floor ooolinux response:

Quote: refer to the third floor early play big play nuclear war reply:

A look at his code indentation 8 don't want to see it, I only accept the indentation 2 g ~ ~ ~


There are too many nested? I usually set to 4,


Indented 8 is a favorite of Linus Torvalds, he says the indentation 4, 2 person for pagan ~ ~ ~


Somebody else's money, large display, small laptop screen can't afford to hurt ~
As if there are 3 case, forget it is lei jun or who,

CodePudding user response:

refer to 6th floor ooolinux response:
https://download.csdn.net/download/u010165006/9835443


Easy to operate, can directly input the answer, enter (check), press enter (the next), enter the answer again,
Practice in the options menu can be set up special (such as special multiply or divide),
Operand can choose (0 ~ 9) within 10 or 20 (0 ~ 19), within the scope of the division for the quotient and the divisor

CodePudding user response:

refer to the eighth floor ooolinux response:
Quote: refer to 7th floor early play big play nuclear war reply:

Quote: refer to 4th floor ooolinux response:

Quote: refer to the third floor early play big play nuclear war reply:

A look at his code indentation 8 don't want to see it, I only accept the indentation 2 g ~ ~ ~


There are too many nested? nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related