How to Easily Write logic in C,C++,Java ?

I love C,C++..But i don't no how to easily write logic for any problem...Any solutions ?