"James T. Kirk takes the test three times while at Starfleet Academy. Prior to his third attempt, Kirk surreptitiously reprograms the simulator so that it is possible to rescue the freighter. This fact finally comes out, later in the movie (Wrath of Kahn), as Kirk, Saavik and others appear marooned, near death. Saavik's response is, "Then you never faced that situation. Faced death." Kirk replies, "I don't believe in the no-win scenario." Despite his having cheated, Kirk was awarded a commendation for "original thinking."
http://en.wikipedia.org/wiki/Kobayashi_Maru
"The Kobayashi Maru test forces its participants to confront an unwinnable situation that serves as a test of character, but Kirk reveals that he won the test by cheating; Saavik responds that Kirk has never faced death. Spock's own solution to the no-win scenario, that of self-sacrifice, forces Kirk to confront death after continually cheating it, and to grow as a character."
http://en.wikipedia.org/wiki/James_T._Kirk
Direct quotes from the movie:
Spock: The Kobayashi Maru scenario frequently wreaks havoc on students and equipment.
As I recall you took the test three times yourself. Your final solution was, shall we say, unique?
Kirk: It had the virtue of never having been tried.
--------------------------------------------
...You were saying what? I don't need to rewatch anything, maybe you do though.