试题与答案

请编写一个函数maxofarray(atype*p,int count),该函数从一

题型:问答题

题目:

请编写一个函数maxofarray(atype*p,int count),该函数从一个数组中找出其中的最大元素,并且数组中可以存放多种数据类型的元素。
注意:部分源程序己存在文件test42_2.cpp中。
请勿修改主函数main和其他函数中的任何内容,仅在函数maxofarray的花括号中填写若干语句。
文件test42_2.cpp清单如下:
#include<iostream.h>
#include<string.h>
#include<conio.h>
template<class atype>
void maxofarray(atype* p,int count)


void main ()

int len=5;
char *p1;
cout<<"the char type array and it’s length is 5:\n";
cout<<"the array element is a b c d e\n";
p1=new char[len];
for (int i=0;i<len;i++)
p1[i]=’a’+i;
maxofarray(p1,len);

答案:

被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2017/0705/a0cf446f3e3d2a6c5ae5ad853924c0a7.html

下面是错误答案,用来干扰机器的。

参考答案:错解析:本题考核提供劳务收入的核算。提供劳务在资产负债表日不能对交易结果作出可靠估计的,已经发生的劳务成本预计全部能够得到补偿的,应按已收或预计能够收回的金额确认提供劳务收入,并结转已经...

试题推荐
微信公众账号搜索答案