十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
#pragma once void ShellSort(int* array, size_t n) { int gap = n; while (gap > 1) { gap = gap/3 + 1; for (size_t i = 0; i < n-gap; ++i) { int end = i; int tmp = array[end+gap]; while ((end >= 0) && array[end] > tmp) { array[end+gap] = array[end]; end -= gap; } array[end+gap] = tmp; } } }