u011456058的博客

#include<stdio.h>void insertsort(int a[], int len){int i, j, temp;for (i = 1; i < len; i++){temp = a[i];for (j = i – 1; j >=0;j–){if (a[j]>temp){a[j + 1] = a[j];}else{break;}}a[j + 1] = temp;}}void main(){int i;int a[] = {1,2,4,5,89,7,6,2,3};int len = sizeof(a) / sizeof(int);insertsort(a,len);for (i = 0; i < len; i++){printf("%d,", a[i]);}printf("\n");}

,有了你,我不再作孤飞于蓝天的雄鹰,

u011456058的博客

相关文章:

你感兴趣的文章:

标签云: