c语言中用冒泡排序法排列下列十个数字从小到大1,3,6,8,2,7,9,0,4...答:include <stdio.h>int main(){ int a[10]={1,3,6,8,2,7,9,0,4,5};int i,j;for(i=0;i<10;i++){ for(j=0;j<9-i;j++){ if(a[j]>a[j+1]){ int t=a[j];a[j]=a[j+1];a[j+1]=t;} } } for(i=0;i<10;i++){ printf("%d ",a[i]);} return 0;...
C语言如何用冒泡排序法对8个数进行从小到大排序并输出每一轮排序结果...答:int main(int argc,char *argv[]){ int a[8]={8,5,9,1,4,2,7,6},i,j,k;printf("OLD: ");for(k=0;k<8;printf("%2d",a[k++]));putchar('\n');for(i=0;i<8;i++){ for(j=0;j<7;j++)if(a[j]>a[j+1])k=a[j],a[j]=a[j+1],a[j+1]=k;printf("...