Each chicken and pig has one head. Chickens have two legs each and pigs have 4 each.
So if c=number of chickens and p=number of pigs:
c+p=100 and 2c+4p=270, that is, c+2p=135.
c=100-p=135-2p, therefore 100-p=135-2p, 2p-p=135-100, p=35. So there are 35 pigs and 100-35=65 chickens. This can be written (c,p)=(65,35).