填空题

若有以下程序:
#include <iostream>
using namespace std;
class sample
int x;
public:
sample()
void setx(int i)

x=i;

friend iht fun(sample B[],int n)

int m=0;
forint i=0;i<n;i++)
if(B[i].x>m)
m=B[i].x;
return.m;

;
int main ( )
sample A[10];
int arr[]=90,87,42,78,97,84,60,55,78,65;
for(int i=O;i<10;i++)
A[i].setx(arr[i]);
cout<<fun(A, 10)<<end1;
return 0;
该程序运行后的输出结果是 【13】

答案: 97
题目列表

你可能感兴趣的试题

填空题

算法的复杂度包括时间复杂度和 【1】

答案: 空间复杂度
填空题

软件测试是为了 【5】 而执行程序的过程。

答案: 发现错误
填空题

在类中定义和实现的函数可以称为 【9】

答案: 内联函数
微信扫码免费搜题