Four Yuan 2--design thought
Requirement 1: Avoid duplication of questions
(1) Control by Srand (Time (NULL));
Requirement 2: Can be customized (quantity/printing method)
(1) Define a parameter, use the number of user input to control the quantity;
(2) The output format can now be set two ways, one way is the longitudinal x-ray, the other is the x*y format output, where x, Y can be controlled by the user choice.
Requirement 3: Control parameters
(1) All parameter control should be selected by the user, the control is implemented in the main function, the printing function is designed separately
(2) The value range can be set several output functions, the user chooses
(3) Whether there is a multiplication method, can be controlled in the output function, the user to choose
(4) The addition or subtraction of negative numbers can be achieved by the parameter comparison size
Overall design: The program involves a lot of loops, a layer of design.
Arithmetic 2 design ideas