单项选择题
有以下程序:
#include<iostream>
using namespace std;
class sample
{
private:
int x;
public:
sample(int a)
{
x=a;
friend double square(sample s);
};
double square(sample s)
{
return S.X*S.K;
}
int main()
{
sample s1(20),s2(30);
cout<<square(s2)<<endl;
return 0;
}
执行结果是
____
。
A.20
B.30
C.900
D.400
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
不能作为重载函数的调用的依据是
A.参数个数
B.参数类型
C.函数类型
D.函数名称
点击查看答案&解析
单项选择题
有下列程序:#include<stdio.h>void main(){char *a[]={ abcd , ef , gh , ijk );int i;for(i=0;i<4;i++)printf( %c ,*a[i]);}程序运行后的输出结果是____。
A.aegi
B.dfhk
C.abcd
D.abcdefghijk
点击查看答案&解析
相关试题
已知__--X树中序遍历序列是cbade,它的...
当循环队列非空且队尾指针等于队头指针时,...
若有以下程序:#include〈iostream〉using...
Staff类含有int型数据成员ID,两个Staff对...
有如下程序:#include<iostream>using ...