题目内容:
编写一组重载的排序函数,可以对两个整数、三个整数、四个整数、整数数组从大到小排序,函数名为sort,其中数组排序应使用递归的方法,另补充print函数,在一行显示排序后的数组元素。
主函数如下:
int main()
{
int a,b,c,d;
int data[100];
int k,n,i;
cin>>k;
switch(k)
{
case 1:
cin>>a>>b;
sort(a,b);
cout<
#include <iostream>
using namespace std;
void sort(int &a,int &b){
if(a<b){
int tmp = a;
a = b;
b = tmp;
}
}
void sort(int &a,int &b,int