Finally, the basic interface of the program has been basically completed, and the rest is the design code part of the function. It is intended to design into interactive mode. It is to make a small game. Now it seems to be the core first. The part is done after reading the situation, and I have time. When the design interface, I met a small trouble. It is randomly generated four numbers my code for this: void cmy24pointdlg :: onstart () {// Todo: add your control notification handler code here // generate 4 random number for (int i = 0; i < 4; i ) {SRAND (NULL)); NUM [i] = rand ()% 13;} // put the random number on the dialog on SetDLGITEMINT (IDC_NUM1, NUM [0], FALSE); Setdlgitemint (IDC_NUM2, NUM [1], FALSE); SetDLGITEMINT (IDC_NUM3, NUM [2], FALSE); setdlgitemint (IDC_NUM4, NUM [3], FALSE);} The four random numbers generated are the same. Then change to SRAND (NULL)); for (int i = 0; i <4; i ) {NUM [i] = rand ()% 13;} This problem solves the kind I used. Methods The seeds that generate a random number of seeds are the same, and the random number produced each time is true. Special Thanks for the help of several brothers on the forum. Since there is no basic operation function of the stack, I wrote a #include
Const maxnum = 100; class stack {private: int top; // Pointing to char stacklist [maxNum] on top of the stack; PUBLIC: stack () {top = -1;} // ~ stack (); void initstack (); / / Initialize S is empty stack VOID PUSH (CHAR X); // Plug the element X into the stack top char pop POP (); // Delete the top element Bool Sempty (); // Roster Suan Returns true, otherwise returns false char gettop (); // Returns the top element void clearstack (); // 将 清 s s s; 中 中 中 中数 中 v // Display element // void destroystack (); // destroy the stack S structure};
/ / Operating the stack void stack :: initstack () {top = -1;}
Void Stack :: Push (CHAR X) {IF (TOP == MaxNum-1) {CERR << "The stack is full of" << Endl;} else {top ; stacklist [top] = x;}}
Char Stack :: POP () {IF (TOP == - 1) {CERR << "The stack has been empty" << Endl; exit (1);} else {return stacklist [top]; top-;} }
Bool stack :: sempty () {=== - 1) {return 1;} else {return 0;}}
Char stack :: gettop () {if (-1 == TOP) {CERR << "The stack has been empty" << Endl; exit (1);} else {return stacklist [top];}} void stack: : ClearsTack () {if (-1 == TOP) {CERR << "The stack has recently" << endl; exit (1);} else {top = -1;}}
Int Stack :: stacklength () {returnit 1;}
Void Stack :: stacklist () {// cstring str; if (-1 == TOP) {CERR << "The stack has been empty" << Endl; exit (1);} else {char * str = new char [TOP]; for (int i = 0; i / * void stack :: destroystack () { } * / There are two key issues to complete 1) The most expressive suffix in the evaluation of the suffix expression next time.