单项选择题

The magnetic compass operates on the principle that().

A.like magnetic poles attract
B.unlike magnetic poles repel
C.unlike poles attract
D.the poles of the compass line up with the geographic poles of the earth