#include<stdio.h>
main()
{
int a[10], tem = 0, smlr;
for (int i = 0; i < 10; i++)
scanf_s("%d", &a[i]);
for (int old = 0; old < 9; old++)
{
smlr = old;
for (int new = 1 + old; new < 10; new++)
if (a[new] < a[smlr])
smlr = new;
if (smlr != old)
{
tem = a[smlr];
a[smlr] = a[old];
a[old] = tem;
/*
tem = a[old];
a[old] = a[smlr];
a[new] = tem;
*/
}
}
for (int i = 0; i < 10; i++)
printf("%d ", a[i]);
return 0;
}
请问注释内和注释外的交换部分有什么区别,为什么其中一个会报错