If your trying to get in shape, all you have to do is move your body actively for a certain period of time to burn calories. If your trying to gain muscle, I suggest hiring a trainer that will give you a diet based off your body type. (Ectomorph, endomorph. Etc.) Reallistically I hate running because I tend to get problems in my knees but I think swimming is very fun so I will probably swim more than run. Point is, as long as your moving your body burning calories and staying off of junky food (I'm sure I don't need to explain junky food) you will lose weight. I go to the gym daily and try to eat healthy Monday to Friday. On saturdays and sundays I don't go to the gym and I can eat what I want.
Another thing: when you describe your legs being in pain, do you mean it as a healthy pain like soreness or a piercing pain in your knee or ankle?