My personal congrates on that code, in my opion its very nicely written, i especially liked the looping gathering up the 4,3,2 or one of a kinds, and grouping them into a resulting hand.
I didnt run the code, rather just examined it here, thinking my way down (which got a bit harder on the second half i must say, trying to see whats happening)
And these two small points that could be adjusted are in no way saying anything is wrong, i just noticed them as i was going along.
(1) "while (%c > 0) {"
this can be "while (%c > 2)" since when %c = 2, it well be decreased to 1, and there is no 1 cards only 2 to 14. (of course having %c = 2 and 1 makes no differnce as it just scans for cards matching 1 and 0 and find none)
(2) ;1 pair
elseif (%sa <= 2) {
should be < not <= since it cant be == as thats taken up in the elseif above it (this is so minor i almost didnt mention it)