The Milwaukee Bucks snapped a four-game losing streak with a 103-98 win over the Miami Heat.