问题

. He was just about to give up and returnto his bedroom for a good rest ________ he had a bright idea.
A:but
B:while
C:until
D:when
B:while
C:until
D:when
正确答案是: