Don't cooperate with groups of men who harass. Act to frustrate or oppose harassment. If a woman doesn't respond, almost certainly she didn't welcome the comment. Even if she smiles or says thank you, inwardly she may resent the intrusion. She may be polite out of fear that the situation will escalate.
Some men seem to think that they have a right to make comments about women's appearance.
No one gave them such a right. It doesn't matter what women are wearing. It is simply presumptuous and rude to make such comments, even if they are favourable. Don't ask for her name and phone number. It's an intrusion to ask a person for personal details, unless there is some pressing reason.