"When to take medicine" CodeChef Challenge MEDIC
You don't check whether the input is invalid.
Try to extract useful well-named functions, like int days(int month, int year) and bool is_leap_year(int year).
You can extract the numbers directly from std::cin, the colon will be left behind.
And the colon can thereafter be extracted like any other single character.
As an aside, using scanf() would probably be easier than juggling streams.
break should be indented like any other Statement. It does not deserve more indentation (first occurrence), nor less (second occurrence).