Try stepping through it in the debugger. The problem should become immediately obvious.
Use f9 to set a breakpoint, f5 to start the program in the debugger, f10 to step line by line.
Autos is a good window to have visible; it displays all the info that is relevant to the current statement.
Enter "go 4 expert" at the first cin>>t (the debugger will wait for input; you may need to Alt-Tab to the DOS box containing the process) and watch what happens on the second time through the outer while loop, after cin>>t processes the 4.