Underway in the ocean in a monohull will remind you of the monkeys in the zoo - you are swinging from handhold to handhold so you get a lot of exercise. Not to mention grinding winches and hauling sheets, anchors and dinghies. One really great modification I made to my boat was to install handrails - teak - horizontally along the sidewalls inside the boat and - since I have a pilothouse - 1.25" pipes vertically around the walls of the pilothouse. You are perpetually "hanging on" almost all the time you are underway.
In harbor is quite different, things are much more settled onboard. But since it is not practical to stow an automobile onboard - we walk everywhere. Most of the time we are carrying backpacks which after a day of shopping for food and other things end up weighing in at 10-20 lbs. for the long walk back to the boat/dinghy. Again exercise is not an issue. You get it whether you want it or not. Add in swimming, snorkeling, kayaking, hanging upside down in the bilge fixing things and static exercise is not necessary.
But you much watch the calorie intake in harbor. There are some great places to eat - especially in the French Islands. At sea, we eat minimal food - just don't feel like eating for the first couple of days and thereafter it is pain to go below to cook. So we loose weight easily.