求求大神 看看哪里有问题
#include<stdio.h>#include<time.h>
#define MAX_SIZE 100
#define EXCHANGE(x,y,temp) ((temp)=(x),(x)=(y),(y)=(temp))
void love(int sh[], int n);
main()
{
int n,i;
int sh[MAX_SIZE];
printf("请输入要数字的个数按回车键结束");
scanf_s("%d", &n);
if (n<0 || n>MAX_SIZE)
{
printf("数组申请失败\n");
exit(1);
}
srand((unsigned)time(0));
for (i = 0; i < n; i++)
{
sh[i] = rand() % 100;
printf("%d ", sh[i]);
}
love(sh, n);
printf("\n");
for ( i = 0; i < n; i++)
{
printf("%d ", sh[i]);
}
}
void love(int sh[], int n)
{
int i, j,min,temp;
temp = 1;
for (i = 0; i < n-1; i++)
{
min = i;
for (j = i + 1; j <= n; j++)
{
if (sh[j] < sh[min])
{
min = j;
EXCHANGE(sh[min], sh[i], temp);
}
}
}
}