2. Chapter II loop structure programming

1. The definition of the variable as short as possible.

2. When large numbers doing arithmetic, intermediate results noted that, to avoid overflow.

3. timing function to estimate the efficiency of the algorithm. It contains header #include <ctime>, using the function Clock (), the function returns the program run time so far, divided by CLOCKS_PER_SEC, the seconds value is obtained.

4. the input-output data exist in the file, to facilitate multiple use. Input may be output redirection.

5. kase as the current data number counter (case should have been, but the case of language keywords, to avoid confusion, to kase, Similarly, the counter variable COUNT to be used, but the language has, so to cnt ).

6. After a set of data has been calculated, it is necessary to reset the variables To reset, to avoid affecting the next calculation.

Guess you like

Origin www.cnblogs.com/Hello-Nolan/p/12111516.html