[Cpp]/** Copyright (c) 2012, School of Computer Science, Yantai University * All rights reserved. * file name: 18_2 learning aid software. cpp * Author: Ji Zilong * Completion Date: July 15, January 18, 2012 * version: v1.0 ** input Description: none * Problem description: random generation of a number * program output: omitted * problem analysis: slightly * Algorithm Design: slightly */# include <iostream> # include <ctime> using namespace std; int main () {int I, m, run_num1, run_num2, j = 0, rq = 0, fq = 0, re = 0; srand (time (0); do {run_num1 = rand () % 11; run_num2 = rand () % 11; if (run_num1 <run_num2) {www.2cto.com I = run_num1; run_num1 = run_num2; run_num2 = I;} cout <run_num1 <"-" <run_num2 <"= "; cin> m; if (m = run_num1-run_num2) {cout <"correct" <endl; rq ++; re ++ ;} else {cout <"\ a" <"Incorrect" <endl; fq ++; re --;} j ++;} while (j <5 ); if (j = 5) {cout <"you have been correct" <rq <, an error occurred while "<fq <" Dao Wen "<endl; cout <" your final score is "<re <endl ;}return 0;}. Running result: