标签:inf NPU bsp png i++ include 技术分享 alt sorted
1 #include <stdio.h> 2 int main(void) 3 { 4 int i, j, t, a[11]; 5 6 printf("please input 10 numbers:\n"); 7 8 for(i = 1;i < 11;i++) 9 scanf("%d", &a[i]); 10 11 for(i = 1;i < 10;i++) 12 for(j = 1;j < 11 - i;j++) 13 if(a[j] > a[j+1]) 14 { 15 t = a[j]; 16 a[j] = a[j+1]; 17 a[j+1] = t; 18 } 19 20 printf("the sorted numbers:\n"); 21 22 for(i = 1;i <= 10;i++) 23 printf("%5d", a[i]); 24 25 }
标签:inf NPU bsp png i++ include 技术分享 alt sorted
原文地址:https://www.cnblogs.com/junsircoding/p/bubblesort.html