# Include "stdlib. H"
# Include "stdio. H"
# Deprecision MAX 1000
Void print (int A [], int N ){
Int I = 0;
Printf ("the last:/N ");
While (A [I]! = (-1) {// print
Printf ("% d/N", a [I]);
I ++;
}
}
Void bubble (int A [], int N) {// sort by bubble
Int I, j, temp;
For (I = 0; I <n-1; I ++)
For (j = I + 1; j <n; j ++ ){
If (A [I]> A [J]) {temp = A [I]; A [I] = A [J]; A [J] = temp ;}
}
Print (A, N );
}
Void direct_insert (int A [], int N) {// sort by insert
Int I, j, temp;
For (I = 1; I <n; I ++ ){
Temp = A [I]; j = I-1;
While (temp <A [J] & J> = 0 ){
A [J + 1] = A [J];
J --;
}
A [J + 1] = temp;
}
Print (A, N );
}
Main (){
Int A [Max];
Int I, B;
For (I = 0; I <Max; I ++) {// init
A [I] =-1;
}
I = 0;
While (B! =-1) {// save numbers using an array, set a number for a way out
Scanf ("% d", & B );
A [I] = B;
I ++;
}
I = 0;
Printf ("the form:/N ");
While (A [I]! = (-1) {// print
Printf ("% d/N", a [I]);
I ++;
}
Bubble (A, I); // maopao sort
Direct_insert (A, I); // direct insert sort
Int K;
Scanf ("% d", k );
}