The pet store has 12 fish and 4 hamsters, with the number of fish being three times that of the hamsters and 8 more in total.
Let's denote the number of hamsters as H and the number of fish as F. According to the given information, we can set up a system of two equations:
The pet store has 3 times as many fish as hamsters: F = 3H.
They have 8 more fish than hamsters: F = H + 8.
Now, we can use these equations to find the values of H and F. Substituting the first equation into the second, we get 3H = H + 8, which simplifies to 2H = 8. Solving for H, we find H = 4.
Now that we know the number of hamsters (H = 4), we can find the number of fish using the first equation: F = 3 * 4 = 12.
Therefore, the pet store has 12 fish and 4 hamsters.