题目内容

以下关于成员函数的叙述中,不正确的是( )。

A. 成员函数一定是内联函数
B. 成员函数可以重载
C. 成员函数的参数可以设置默认值
D. 成员函数可以是另一个类的友元函数

查看答案
更多问题

已知a=5,b=10,则条件表达式 a==b 的运行结果为()。

A. True
B. False
C. 1
D. 表达式错误

已知变量 a=2,b="02" ,则表达式 a>b 的值为:

A. False
B. True
C. 不相等
D. 系统报错

下面程序运行后,假设输入的是100,则运行结果是()。x=eval(input('input x:'))if x<0 or x>20:print (x//10)elif 0<=x<5:print(x)elif 5<=x<10:print(3*x-5)elif 10<=x<20:print(0.5*x-2)

A. 10
B. 100
C. 295
D. 48

为统计符合条件“性别(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

答案查题题库