回复 2楼 hellovfp
#include "stdafx.h"
#define N 100
int _tmain(int argc, _TCHAR* argv[])
{
int i;
int j;
int n;
int t;
int a[N];
printf("The count is : ");
scanf("%d",&n);
for ( i=0; i<n; i++ )
{
printf("No.%d number:",i+1);
scanf("%d",&a[i]);
}
for (i=0; i<n-1; i++)
{
for (j=i+1; j<n; j++)
{
if (a[i] > a[j])
{
t = a[i];
a[i] = a[j];
a[j] = t;
}
}
}
printf("After sorted\n");
for (i=0; i<n; i++)
printf("%d\n",a[i]);
return 0;
}