#include <iostream>
using namespace std;
void shellSort(int * data, int len){
int d = len;
while (d>1) {
d=(d+1)/2;
for (int i=0;i<len-d;i++){
if(data[i+d]<data[i]){
int temp = data[i+d];
data[i+d] = data[i];
data[i] = temp;
}
}
}
cout<<"排序后\n"<<endl;
for (int i=0; i<len; i++) {
cout<<data[i]<<"\n"<<endl;
}
}
int main(int argc, const char * argv[])
{
int list[10];
for (int i=0; i<10; i++) {
list[i]= rand();
}
for (int i=0; i<10; i++) {
cout<<list[i]<<"\n"<<endl;
}
shellSort(list, 10);
}