#include <stdio.h>
void InsertionSort(int v[], int len){
int key, i, j;
for(i = 1; i < len; i++){
key = v[i];
j = i - 1;
while(j >= 0 && v[i] > key){
v[j + 1] = v[j];
j--;
}
v[j + 1] = key;
}
}
int main(){
int i;
int v[10] = {7, 3, 1, 5, 2, 6, 4, 8, 10, 9};
InsertionSort(v, 10);
for(i = 0; i < 10; i++)
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIEluc2VydGlvblNvcnQoaW50IHZbXSwgaW50IGxlbil7CglpbnQga2V5LCBpLCBqOwoKCWZvcihpID0gMTsgaSA8IGxlbjsgaSsrKXsKCQlrZXkgPSB2W2ldOwoJCWogPSBpIC0gMTsKCQl3aGlsZShqID49IDAgJiYgdltpXSA+IGtleSl7CgkJCXZbaiArIDFdID0gdltqXTsKCQkJai0tOwoJCX0KCQl2W2ogKyAxXSA9IGtleTsKCX0KfQoKaW50IG1haW4oKXsKCWludCBpOwoJaW50IHZbMTBdID0gezcsIDMsIDEsIDUsIDIsIDYsIDQsIDgsIDEwLCA5fTsKCglJbnNlcnRpb25Tb3J0KHYsIDEwKTsKCglmb3IoaSA9IDA7IGkgPCAxMDsgaSsrKQoJCXByaW50ZigiJWQgIiwgdltpXSk7CgoJc2NhbmYoIiVkIiwgJmkpOwp9