正在加载图片...
int main(void )985460 inti, j, n, t, a[10];i=1n = 6;for(i = ; i< n; i++)j=0:895460scanf("%d", &a[i]);for(i= 1; i< n; i++)j=1:859460for(j = O; j< n-i;j++)j=2:854960if(al] > a[i+1]) (t = aj];j=3:854690a[] = a[i+1];j=4:854609a[j+1]= t;1return o;19 8 5 4 6 0 i=1 j=0: 8 9 5 4 6 0 j=1: 8 5 9 4 6 0 j=2: 8 5 4 9 6 0 j=3: 8 5 4 6 9 0 j=4: 8 5 4 6 0 9 int main(void ) { int i, j, n, t, a[10]; n = 6; for(i = 0; i < n; i++) scanf("%d", &a[i]); for(i = 1; i < n; i++) for(j = 0; j < n-i; j++) if(a[j] > a[j+1]) { t = a[j]; a[j] = a[j+1]; a[j+1] = t; } return 0; }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有