<img src="https://img-blog.csdn.net/20150419204913706?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvem91amlhaHVpMTIz/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" /><img src="https://img-blog.csdn.net/20150419204913706?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvem91amlhaHVpMTIz/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />#include <iostream>
#include <string>
using namespace std;
int main()
{
long c[5]={10100,-123567, 1198783,-165654, 3456};
int a[5]={1,9,0,23,-45};
float b[5]={2.4, 7.6, 5.5, 6.6, -2.3 };
void sort(int []);
void sort(float []);
void sort(long []);
sort(a);
sort(b);
sort(c);
return 0;
}
void sort(int a[])
{int i,j,t;
for (j=0;j<5;j++)
for(i=0;i<5-j;i++)
if (a[i]>a[i+1])
{t=a[i];a[i]=a[i+1];a[i+1]=t;}
cout<<"the sorted numbers :"<<endl;
for(i=0;i<5;i++)
cout<<a[i]<<" ";
cout<<endl<<endl;
}
void sort(long a[])
{int i,j;
long t;
for (j=0;j<5;j++)
for(i=0;i<5-j;i++)
if (a[i]>a[i+1])
{t=a[i];a[i]=a[i+1];a[i+1]=t;}
cout<<"the sorted numbers :"<<endl;
for(i=0;i<5;i++)
cout<<a[i]<<" ";
cout<<endl<<endl;
}
void sort(float a[])
{int i,j;
float t;
for (j=0;j<5;j++)
for(i=0;i<5-j;i++)
if (a[i]>a[i+1])
{t=a[i];a[i]=a[i+1];a[i+1]=t;}
cout<<"the sorted numbers :"<<endl;
for(i=0;i<5;i++)
cout<<a[i]<<" ";
cout<<endl<<endl;
}