Rohit Sharma made a crucial 122 as India began their Cricket World Cup campaign with a six-wicket win over struggling South Africa.