#include
#include
int main()
{
int i,j;
unsigned seed;
int a[10];
printf("please input seed");
scanf("%d",&seed);
srand(seed);
for(i = 0; i < 10; i++)
a[i] = rand() ;
for(i = 0; i < 10 ; i++)
for(j = i+1; j < 10; j++)
{
if(a[i]>a[j])
{
int temp = a[i];
a[i] = a[j];
a[j] = temp;
}
}
for(i = 0;i < 10; i++)
printf("%d\t",a[i]);
printf("\n");
return 0;
}
去百度吧,我学到这已经好久没学了