I just recently started learning C++ - I am using nuwen\'s version of MingW on Windows, using NetBeans as an IDE (I have also MSDN AA Version of MSVC 2008, though I don\'t u
I replicated your test using Cygwin and g++. Your code compiled to 480k with -O2. Running strip on the executable reduced it to 280k.
In general, though, I suspect your problem is the use of the cout << x does a lot more than just printing. There are locales and streams and all sorts of under-the-hood stuff.
If however, having a small executable size is a real, mission-critical objective, then avoid it and use printf or puts. If it's not, then I would say pay the one-time cost of iostream and be done with it.