My ex ended it with me right in the middle of my A-levels and a few days before my 18th Birthday. It's approaching a year ago that this happened actually... but anyway.
The first thing that helped me was when I called one of my friends. I know guys have a reputation of being really unemotional etc but we talked for about an hour and a half (at the time that was loads for me) and he made me feel a lot better.
I suppose everyone does things differently. I'm not the social or partying type, so I didn't really go out and get drunk at all, I preferred to stay in and watch lots of comedies. Family guy and peepshow both cheered me up a bit! But this happened in June and it didn't just go away for ages. Even months later I'd begin to feel terribe about it, but the feeling bad happened less and less often. The only thing which made me completly over it though was finding somebody else. But that's only an option after a good half a year or so gap, or at least that was the case for me.
In the more immediate term, I know from experience, you're really quite helpless. You can take our advise but it's only little short term bursts of happiness you'll get. There will be a lot of hard times for you as well but that's all normal, and eventually, however long it takes, it honestly will get easier.
As for your exams, I found that being emotionally crippled wasn't too bad. The fact I wasn't sleeping for a while let me revise all night, I actually got 120/120 in an exam I did the next day so don't worry about it ruining your exams too much!