请各位帮忙简化算法
//输入四个int 将它们按从大到小的顺序输出#include "stdafx.h"
#include<iostream>
using namespace std;
int main()
{
void sort(int a,int b,int c,int d);
int a,b,c,d;
cout<<"输入四个要排序的数字,中间用空格隔开。"<<endl;
cin>>a>>b>>c>>d;
sort(a,b,c,d);
return 0;
}
void sort(int a,int b,int c,int d)
{
int t;
if(a<b){t=a;a=b;b=t;}
if(c<d){t=c;c=d;d=t;}
cout<<"已将四个数从大到小排序:"<<endl;
if(b>c)cout<<a<<","<<b<<","<<c<<","<<d<<endl;
if(d>a)cout<<c<<","<<d<<","<<b<<","<<a<<endl;
if(a>c&&d>b)cout<<a<<","<<c<<","<<d<<","<<b<<endl;
if(c>a&&b>d)cout<<c<<","<<a<<","<<b<<","<<d<<endl;
if(d>b&&c>a&&a>d)cout<<c<<","<<a<<","<<d<<","<<b<<endl;
if(b>d&&c>b&&a>c)cout<<a<<","<<c<<","<<b<<","<<d<<endl;
}
该程序的算法是否可以简化?