#include
using namespace std;
#define N 1000
void sortArr(int s[],int n)
{
int i,j,k;
int temp;
for(i=0;i{
k=i;
for(j=i+1;jif(s[k]>s[j]) k=j;
t=s[i];
s[i]=s[k];
s[k]=t;
}
}
int main()
{
int Arr[N];
int count=1;
int i=0;
cout<<"输入整数,输入0结束"<cin>>s[i];
while(s[i]!=0)
{ i++;
cin>>s[i];
count++;
}
sortArr(Arr,count);
for(i=0;icout< cout< return 0;
}
#include
using namespace std;
int main(void)
{
int *a;
int i,j,n;
cout<<"请输入要排序的个数:";
cin>>n;
a = new int[n];
for(i=0;icin>>a[i];
for(i=0;i{
int k = i;
for(j=i+1;jif(a[j] if(k != i)
{
int temp = a[k];
a[k] = a[i];
a[i] = temp;
}
}
for(i=0;icout< cout< return 0;
}