I have written a little GreaseMonkey script for the automatic generation of the stub program with test cases. It works in Firefox if you install GreaseMonkey plugin or in Chrome (out of the box). The script modifies the problem description page and appends the source of the program to the bottom of the page, so you can copy-paste it into your favorite editor.
Implement your solution in the TheSolution function. Use input and output variables instead of the cin and cout in the TheSolution function.
Feel free to post any comments and bug reports. I can implement it for the other programming languages, if you sent me a suitable template.
You can install it from here: http://userscripts.org/scripts/show/117771 (click on the green Install button to the right).
UPDATE 12.01.2012
Updated the script. Now it works with a changed HTML of the site.
UPDATE 12.01.2012
Updated the script. Now it works with a changed HTML of the site.