h=p+c (heads equals the sum of people and cats) since there are 26 heads:
p+c=26, solve for c, subtract p from both sides
c=26-p, now for feet...
2p+4c=f, using c found above gives you:
2p+4(26-p)=f and we are told that there are 84 feet so:
2p+4(26-p)=84 perform indicated multiplication on left side
2p+104-4p=84, combine like terms on left side
-2p+104=84 subtract 104 from both sides
-2p=-20 divide both sides by -2
p=10, and since c=26-p
c=26-10
c=16
So there are 10 people and 16 cats in the room.