Cedric seems to be more observant of the actual rules than Harry, probably because he's a 'proper' champion rather than an accidental entrant. It's made very clear that the contestants aren't supposed to be getting any support from their respective headmasters and presumably this also goes for champions helping each other out. He goes as far as he can without actually giving him the answer.
‘It’s all right,’ said Moody, sitting down and stretching out his
wooden leg with a groan. ‘Cheating’s a traditional part of the
Triwizard Tournament and always has been.’
‘I didn’t cheat,’ said Harry sharply. ‘It was – a sort of accident
that I found out.’
Moody grinned. ‘I wasn’t accusing you, laddie. I’ve been telling
Dumbledore from the start, he can be as high minded as he likes, but
you can bet old Karkaroff and Maxime won’t be. They’ll have told their
champions everything they can. They want to win. They want to beat
Dumbledore. They’d like to prove he’s only human.’
There's also the fact that Harry, given the antipathy between Cedric's supporters and himself, might simply ignore or disbelieve the advice given.
Harry had not forgotten the hint that Cedric had given him, but his
less-than-friendly feelings towards Cedric just now meant that he was
keen not to accept his help if he could avoid it. In any case, it
seemed to him that if Cedric had really wanted to give Harry a hand,
he would have been a lot more explicit. He, Harry, had told Cedric
exactly what was coming in the first task – and Cedric’s idea of a
fair exchange had been to tell Harry to take a bath. Well, he didn’t
need that sort of rubbishy help – not from someone who kept walking
down corridors hand in hand with Cho, anyway. And so the first day of
the new term arrived, and Harry set off to lessons, weighed down with
books, parchment and quills as usual, but also with the lurking worry
of the egg heavy in his stomach, as though he was carrying that around
with him too.