Let x be the number of lions and y be the number of ostriches.
1) x + y = 35 or y = 35 - x
2) 4x + 2y = 78
substitute eq(1) into eq(2):
4x - 2(35 - x) = 78
4x - 70 + 2x = 78
6x = 148
x = 24.666...
using eq(1):
y = 35 - 24.666... = 10.333...
Have you written the question correctly? The values should be integers.