But you have to swim a lot to get that build. You also have to use different types of strokes and make sure you're in good form. Also, most professional swimmers train regularly at the gym and sometimes run too. My little bro was a swimmer and his schedule was basically swim, gym and jogging 5-6 days a week.
The best way to get a great bod is to combine weight training (and don't be afraid to lift heavy once you work up to it), cardio (swimming/running/etc) and to eat right. Eat healthy, clean food, lots of protein, healthy carbs and healthy fats.
Phelps looks the way he does because he's an Olympic athlete and trains his ass off. You're looking at years of rigorous training.
I do both except during the winter because the weather doesn't allow me to run outdoors. Right now I swim 6 times a week and I've seen a way bigger improvement in my shape than when I was running regularly. I find it harder to "upgrade" your running workout because the soreness doesn't go away as fast. Having a cramp, a sore ankle or weak knees is likely to slow you down and keep you from pushing yourself further more in your workout. I find that this problem doesn't really occur in swimming. Unless I eat right before I swim, I never have cramps when I swim. I think swimming is a more complete exercice than running because its low injury risk allows you to work out hard and often at any level. Besides, I always find that I can get back to running really easily whenever I'm swimming on a day to day basis.
If you're asking yourself which exercice would be better to shape yourself up, I'd strongly suggest swimming at first and adding some running after a while once you're in a good shape. I'll save you that horrendous phase when you're running out of breath and sore everywhere all the time. Swimming won't tone your legs much at first though, I'll tell you that. It's going to develop your shoulders and upper body a lot more because swimming is all about pulling your body forward and in and out of the water. Plus, a lot of swimmers don't have a good kick or barely kick when swimming freestyle - even more if you're pretty thin or rather light. If you're heavy, you'll have to kick more because you'll tend to sink otherwise. So if your goal is to get strong legs (thighs, calves), the best is running and doing a lot of kick. To tone all of your upper body, swimming is way better.
I know everyone says swimming, but I'm not so sure. I swam everyday one summer and didn't notice any weight loss or better body. I think if you are going to do swimming you really need to push yourself and swim for long periods of time.