第2个回答 2012-06-01
#include<stdio.h>
#include<stdlib.h>
int main()
{
int i,j;
unsigned seed;
int a[101];
printf("please input seed");
scanf("%d",&seed);
srand(seed);
for(i = 0; i < 100; i++)
a[i] = rand() % 10 +1;
for(i = 0; i < 100 ; i++)
for(j = i+1; j < 100; j++)
{
if(a[i]>a[j])
{
int temp = a[i];
a[i] = a[j];
a[j] = temp;
}
}
for(i = 0;i < 100; i++)
printf("%d\t",a[i]);
printf("\n");
return 0;
}本回答被提问者和网友采纳