That's funny. It works fine on my computer. It does give the following warning:
In file included from /usr/include/c++/3.2.2/backward/iostream.h:31,
/usr/include/c++/3.2.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using
one of the 32 headers found in section 18.104.22.168 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.
The first time I ran it, the output was on the same line as the prompt. So I added a newline, but it runs fine on my computer running GCC 3.2.2
By the way you might get a quicker reply next time if you put this in the programming forum.