Posting the relevant portions of the script, found here: Star Trek II: The Wrath of Khan
[Beginning of the film, just after Saavik takes the Kobiyashi Maru test]
SAAVIK
(fights emotion) I don’t believe this was a fair test of my command abilities.
KIRK
And why not?
SAAVIK
Because… there was no way to win.
KIRK
A no-win situation is a possibility every commander may face. Has that never occurred to you?
SAAVIK
… No sir. It has not.
KIRK
How we deal with death is at least as important as how we deal with life, wouldn’t you say?
SAAVIK
(falters) As I indicated, Admiral, that thought had not occurred to me.
KIRK
Well, now you have something new to think about. Carry on.
[when Saavik confronts Kirk in the turbolift]
SAAVIK
(continuing) May I speak, sir?
KIRK
Self-expression doesn’t seem to be one of your problems. (pause) You’re bothered by your performance on the Kobayashi Maru.
SAAVIK
I failed to resolve the situation.
KIRK
There is no correct resolution. It’s a test of character.
SAAVIK
May I ask how you dealt with the test.
KIRK (amused) You may ask.
She starts.
KIRK
(continuing) That’s a little joke.
SAAVIK
Humor… It is a difficult concept… it is not logical…
[In the Genesis Cave]
SAAVIK
Sir? May I ask you a question.
KIRK
What’s on your mind, Lieutenant?
SAAVIK
The Kobayashi Maru, sir.
KIRK
Are you asking me if we’re playing out that scenario now, Lieutenant?
SAAVIK
On the test, sir. Will you tell me what you did? I would really like to know.
Kirk looks at Bones, who smiles -
BONES
Lieutenant, you are looking at the only Starfleet cadet who ever beat the no-win scenario -
SAAVIK
How?
KIRK
I reprogrammed the simulation so it was possible to rescue the ship.
SAAVIK
WHAT?
DAVID
(laughs) He cheated!
KIRK
I changed the conditions of the test. I got a commendation for original thinking. (pause) I don’t like to lose.
SAAVIK
Then - you never faced that situation - faced death…
He picks up the communicator.
KIRK
I don’t believe in the no-win scenario.