Both pigs and chickens have one head :P So:
100=p+c let's solve this for c:
c=100-p we will need this value of c in a moment.
Chickens have 2 legs while pigs have 4 and we are told that there are 270 legs:
2c+4p=270, now using the value of c we found earlier in this we get:
2(100-p)+4p=270
200-2p+4p=270
2p+200=270
2p=70
p=35, and since c=100-p
c=65
So there were 35 pigs and 65 chickens.