For these questions, you get what's known as derived units, or the combination of different metric units. That "1400J/ (45g)(37 C)" problem is involving the unit for specific heat. For that problem in particular, you would solve the problem normally algebraically, then express the derived unit as "J/g C."
Another way of thinking about it is thinking about meters per second or miles per hour. You can't divide a distance by a duration and get a simple unit; You get a derived unit. There are exceptions to this rule, for instance a Joule is a name for the common derived unit of kg·m2/s2 expressing a unit of energy. This is common in physics and chemistry for expressing common derived units.