怎么用函数重载和模板两种方法 来进行N个数据(包括单精度,双精度,整形...答:void PopSort(float array[],int n);void PopSort(double array[],int n);template<class T> void PopSort(T array[],int n,int flag);//模板函数定义 template<class T> void print(T array[],int n);void main(){ //测试函数 //int array[10]={23,32,12,11,31,90,100,55,26...
用一个同名函数对N个数据进行从大到小排序答:调用函数时,你的参数列表不正确!int main(){ int a[5]={5,4,96,87,54};float b[5]={5.1,22.1,36.002,25.6,55.3};sort(a,5);sort(b,5);/**for(int i=0;i<5;i++)cout<<a[i]<<" ";cout<<endl;for(int j=0;j<5;j++)cout<<b[j]<<" ";cout<<endl...