You might have to tweak the HTML. For example, I was able to achieve something like what you want (not exactly though):
Test:
int x = 5;
Using this code:
<br />
Test: <pre lang="text" style="width: 70%; float: right; display: inline;">int x = 5;</pre>
<div style="clear: left;"></div>
I'm not a CSS guru, so some of that is probably weird, but you get the idea. I'm not sure there is a way that CP facilitates that allows you to give a code block a title/header, so you may have to hack it yourself. You could also ask in the article writing forum. And if the functionality doesn't exist, you could ask in the site bugs/suggestion forum.