C=number of cows, S=number of sheep, number of goats=100-(C+S).
Cost of animals: 10C+3S+0.5(100-C-S)=100,
10C+3S+50-0.5C-0.5S=100,
9.5C+2.5S=50, 19C+5S=100,
C=(100-5S)/19=(95+5-5S)/19=5-5(S-1)/19.
We are dealing with whole numbers of each animal so S-1 must be divisible by 19.
If S-1=19, S=20⇒C=0, number of goats=80. Note that S cannot exceed 20, because that would make C<0.
Check cost: Cows=$0, Sheep=$60, Goats=$40, total=$100. Check quantity: Cows=0, Sheep=20, Goats=80, total=100.