4. The number of solutions to the equation $\sin ^{x} a+\cos ^{x} \alpha=1\left(0<\alpha<\frac{\pi}{2}\right)$ is ( ).
(A) 0
(B) 1
(C) 2
(D) 3
4. B.

When $x>2$, from $\sin ^{x} \alpha\sin ^{2} \alpha, \cos ^{x} \alpha>\cos ^{2} \alpha$, we get $\sin ^{x} \alpha+\cos ^{x} \alpha>1$, in this case there is also no solution. Therefore, the only solution is $x=2$.