询问一个问题
#include "stdio.h"void selection_sort (int a[], int n)
{
int i,j,k;
for (i=0; i<n; ++i)
{
k=i;
for (j=i+1; j<n; ++j)
if (a[k] >= a[j])
{
k=j;
printf ("j=%d\n",j);
}
printf ("j=%d\n",j);
j=a[i];
a[i]=a[k];
a[k]=j;
printf ("j=%d, a[i]=%d, a[k]=%d\n\n", j, a[i], a[k]);
}
}
int main()
{
int a[]={3,6,1}, i;
selection_sort (a,3);
for(i=0; i<3; ++i)
printf ("%d", a[i]);
return (0);
}
用笔在纸上如何求出这个结果?