Let the number of shirts bought be x and the number of pant bought be y.
x + y = 15 --- (1)
x - y = 7 --- (2)
From (2), we have:
y = x - 7 --- (3)
Substituiting (3) into (1), we will get:
x + x - 7 = 15
2x = 15 + 7
2x = 22
x = 22 / 2
x = 11
Substituting x = 11 into (3), we will get:
y = 11 - 7
y = 4
Thus, x = 11 and y = 4.
Hence, 11 shirts and 4 pants were bought.