This is almost certainly "Fool's Mate" by Robert Sheckley.
The fleets are commanded by computers that are so advanced that they can predict exactly each other's strategy, and therefore will never attack unless they have an advantage. Neither has a clear advantage in attack, but both have an advantage if they stay on defense; and so they stay. Everyone on board the Earth fleet knows that in about two years' time the odds will be so good for the adversary that they will attack, and win. Unless they make some deployment error and get massacred even earlier.
Ellsner, a consultant from Earth, gets this explanation from General Branch and refuses to accept it. Meanwhile the men slowly go crazy under the tension.
In the end,
Ellsner recruits Nielson, a pilot who cracked under the stress, to pilot the whole fleet. He's totally bonkers, so his strategy is crazy and suicidal -- the enemy computer pauses to analyze the strategy, because its programming says there is always a strategy - and finds nothing. According to the programming, the computer impassively waits for a rational pattern to emerge, while its ships are wiped from the board.
The story can be read on Google Books (in this edition the Omar Khayyam quote seems to have gotten messed up).
A similar concept (a CPC having problems dealing with human realities) is present in Mack Reynold's 1967 "The Computer War". Something vaguely akin to this briefly appears in John Wyndham's The Outward Urge, with killer robots attacking a base on the Moon.