He used not to work hard.When the teacher had class,he pretended to listen to the teacher carefully.
表示过去习惯于做某事可用used to+动词原形,否定形式可以写成used not to do,所以本题的第一句可翻译成He used not to work hard。本题的第二句含有时间状语从句,可以用when来引导,本题描述的是过去,要用过去时,故老师上课可以翻译成the teacher had class,假装做某事可翻译pretend to do,听课可以翻译成listen to the teacher,修饰动词听应该用副词carefully,故本题的第二句可翻译成When the teacher had class,he pretended to listen to the teacher carefully。