为统计符合条件“性别(gender)为男,且职业(occupation)为老师,且年龄(age)40以下”的人数,下面if语句中正确的是()。
A. if (gender="男" and age<40 and occupation="老师"):n+=1
B. if (gender=="男" and age<40 and occupation=="老师"): n+=1
C. if (gender=="男" and age<40 or occupation=="老师"): n+=1
D. if (gender="男" or age<40 or occupation="老师"): n+=1