import std.stdio; void shell_sort(int[] arr, int len) {//这是我自己写的一个Shell排序 int gap, i, j; int temp; for (gap = len >> 1; gap > 0; gap = gap >> 1) for (i = gap; i < len; i++) { temp = arr[i]; for (j = i - gap; j >= 0 && arr[j] > temp; j -= gap) arr[j + gap] = arr[j]; arr[j + gap] = temp; } }
int[100] a = [100,100,100,345,11,12350,23]; int main(string[] args){ int n;int c; readf("%d",&n); for (int i = 0 ; o < n;i ++) readf("%d",&a[i]); shell_sort(a,8); for(int i = 1;i < n;i ++){ c = a[i]; if(!i)write(a[i]," "); elseif(c != a[i-1])write(a[i]," "); else ++i; } return0; }