单项选择题

The students ______ busily when Miss Brown went to get a book she ______ in the office.

A.had written, left
B.were writing, has left
C.had written, had left
D.were writing, had left