If the students are labelled, and you are told the labels of the students who did well in test A, and the labels of those who did well in test B and likewise for test C, then your method of solving the problem is all good.

If you didn't know which student had done well on which test among A, B and C, then using the inclusion-exclusion principle would be the way to go.