标签:eof sizeof i++ ++ temp 排序 \n size []
int arr[] = {2,34,4,55,43,6,7,8,100}; int len = sizeof(arr) / sizeof(arr[0]); for (int i = 0; i < len; i++) { for (int k = 0; k < len - 1 -i; k++) { if (arr[k] > arr[k + 1]) { int temp = arr[k]; arr[k] = arr[k+1]; arr[k+1] = temp; } } } for (int i = 0; i < sizeof(arr) / sizeof(arr[0]); ++i) { printf("arr[%d] = %d\n", i, arr[i]); }
标签:eof sizeof i++ ++ temp 排序 \n size []
原文地址:https://www.cnblogs.com/mayichen0823/p/10162183.html