?????e??????C????
????????? ???????[ 2010/6/3 13:20:36 ] ????????
#include <stdio.h>
void bsort(char *arr?? int len)
{
int i?? j?? k?? t?? cnt = 0;;
????for(i = len - 1; i > 0; i = k) {
????????for (j = 0?? k = 0; j < i; j++) {
????????????if (*(arr + j) > *(arr + j + 1)) {
?????????????? t = *(arr + j);
????????????????*(arr + j) = *(arr + j + 1);
????????????????*(arr + j + 1) = t;
????????????????k = j;
????????????}
????????}
????cnt++;
????}
printf("cycle %d "?? cnt);
}
int main(int argc?? char *argv[])
{
int i = 0;
char arr[10] = {3?? 2?? 5?? 4?? 4?? 5?? 6?? 7?? 8?? 9};
????while (i < 10) {
????????printf("%d "?? arr[i++]);
}
i = 0;
putchar(?? ??);
bsort(arr?? 10);
????while (i < 10) {
????????printf("%d "?? arr[i++]);
????}
putchar(?? ??);
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11