Get a round trip ticket in Copenhagen Tourist Bureau that will take you up to Helsingor (of Hamlet fame), then on the ferry to Helsingborg in Sweden. From theretake the train to Malmo and after a nice dinner take the train across the bridge back to Copenhagen.

The ticket is called Øresund rundt and can only be bought in the tourist bureau. It is valid for two days in one direction. So you will have plenty of time to look around each place, although Lund may be a better place to visit than Malmo. Well worth it and thoroughly enjoyable.

On another point don't worry about shopping for food, there are endless supermarkets open all day late into the night every day.