Did you try running the program I posted? Most likely the program runs, displays "Hello, world!" and then because you do not code it to stay open, it immediately closes before you have time to see it, and Code::Blocks correctly says it ran successfully and took 0 seconds to do so.
System() is bad, and won't work with Code::Blocks unless he is using a different compiler.
-----
Code::Blocks should keep the console window open without any code so long as you run it from the IDE. Once you run it, it will close just as a program compiled in VS Express would.
If this question is a problem Code::Blocks then I'd ask it on Code::Blocks.
----
General Mistakes However...
1. Make sure have MinGW and Code::Blocks properly installed
2. Make sure you are properly adding files to your project by adding them to Debug/Release, both or whichever you need.
3. Not as general but some people need to run Code::Blocks as an admin or else it'll act funny.