>> And when you run the program,there is a strange problem:when you want to discard cards,you must use control+z to make system do this,or the system will not response.Why?

What compiler do you use? What input are you giving?

I can see a problem where the second time you run it (after saying 'Y' to again()) the discard function won't work. That is because after typing 'y' the user hits <enter> and when discard calls getline, it stops at the newline leftover from that <enter>. To solve this you'd need to add cin.ignore(1000, '\n') or something similar after your call to cin >>. I'm not sure if this is causing the Ctrl-Z problem, but you never know.


>> really?But my professor always do that.And I don't think it is so bad,at least I am not confused.

Using those headers is legal and not that bad. It is just a little confusing because <cstdlib> is the new style C++ version of the C header, but <math.h> and <time.h> are the old style C versions. This is not a big deal, though.

>> The old .h form is not deprecated
The old .h is deprecated. It is standard, but deprecated by the standard. This means it is legal and valid, but that the <c*> versions are preferred.