首页 > 题库 > 学历提升 > 自学考试 > 自考本科 > 计算题

顺序表类型定义如下:
#define
ListSize 100
typedef struct {
int data[ ListSize ];
int length;
} SeqList; .
阅读程序,并回答下列问题。
int mean (SeqList *SL)
{ int length, meanvalue,k = 0;
length = SL->length;
meanvalue= 0; .
while( k < length )
{ meanvalue += SL->data[k];
k++;
returm meanvalue/length;
}
int f30( SeqList *SL1, SeqList *SL2 )
{ int S1 = mean(SL1); .
int S2 = mean(SL2);
if(S1> S2) returmS1;
else return S2;
}

(1)若SL1->data中的数据为(13, 12, 23, 7, -27, 36, 123, 52, 31),SL1->length=9,SL2->data中的数据为(-7, 17, -23, 18, 37, 22, 41, 15),SL2->length=8 则调用函数f30(&SL1, &SL2)后的返回值是什么?
(2) 函数f30 ()的功能是什么?

参考答案: 查看答案 查看解析 下载APP畅快刷题

相关知识点试题

相关试卷