SyntaxHighlighter is a very easy and useful tool for you to post your code through wordpress.
you just need to use like this:

[sourcecode language="cpp"]
int main()
{
char ch;
while (cin >> ch)
cout << ch;
return 0;
}
[/sourcecode]

Then you get your code pretty as below!!

[sourcecode language="cpp"]
int main()
{
char ch;
while (cin >> ch)
cout << ch;
return 0;
}
[/sourcecode]