كَمْ رَجُلًا لَقِيتَ؟ — How many men did you meet?
رَجُلًا is singular accusative; this is a question.
كَمْ رِجَالٍ لَقِيتُهُمْ! — How many men I met!
رِجَالٍ is plural genitive; this expresses abundance.
First establish the meaning and context, then identify the tamyīz case. Kam itself is indeclinable in both.