e '*':Рcout << c.mul(x, y) << endl;Рbreak;Рcase '/':Рcout << c.div(x, y) << endl;Р}Рreturn 0;Р}Р5. 编写程序Р实现如下功能:Р(1)输入k(<100)个整数到数组x[100]中;Р(2)计算k个数的平均值及大于平均值的元素个数。Р答: Р#include<iostream.h> voidmain () {РInt x[ 100],k, i, n;РDouble sum = 0.0, ave;Рcout << "HowmanyData?\n";Рcin >> k;Рfor (i = 0; i < k; i++) {Рcin >> x[i];Рsum += x[i];Р}Рave = sum / k;Рn = 0;Рfor (i = 0; i < k; i++){Р//求大于平均值的元素个数Рif (x[i] > ave) n++;Рcout << "average=" << ave << "\n";Рcout << "Thereare" << n << "elementslargethanaverage.\n";Р}Р}Р6. 定义函数Рvoid reversion(int ary[],int size);Р逆置数组ary的元素。例如实参数组原来为[ 1,5,3,2,6,8,9,4 ],调用函数Рreversion后变成为[ 4,9,8,6,2,3,5,1 ]。Р答:Рvoid reversion ( int ary[], int size){Рint temp;Рfor (int i = 0; i < size / 2; i++) {Рtemp = ary[i];Рary[i] = ary[size - 1 - i];Рary[size - 1 - i] = temp;Р}Р}