单项选择题

He meant()his homework before lunch, but his pen didn't work.

A. finishing
B. having finished
C. finished
D. to finish