4. A person plays a computer game, first selecting a cell in a $3 \times 3$ grid to place a white piece, and the cells in the same row and column automatically generate white pieces. Then, in the remaining empty cells, they select a cell to place a black piece, and the cells in the same row and column automatically generate black pieces (if there is a white piece, it changes to a black piece). The white and black pieces take turns operating until there are no empty cells left. In the result after each operation, there are some black pieces. This person performs 10 different operations, and the total number of black pieces in the 10 resulting configurations could be ( ).
(A) 18
(B) 20
(C) 30
(D) 50
4.C.

The calculation shows that there are 36 different operations, and in the result of each operation, there are 3 black stones. Therefore, there are a total of 30 black stones.