设A、B为n阶方阵,满足A2=B2,则必有(   ) A.A=B B.A= -B C.|A|=|B| D.|A|2=|B