#include<stdio.h>
int main(){
int arr[1000];
int n;
scanf("%d", &n);
for(int i=0; i<n; i++){
scanf("%d", &arr[i]);
}
for(int i=1; i<n; i++){
int j = i-1;
int key = arr[i];
while(j>=0 && arr[j]>key){
arr[j+1] = arr[j];
j--;
}
arr[j+1] = key;
}
for(int i=0; i<n; i++){
printf("%d ", arr[i]);
}
printf("\n");
return 0;
}
我用dev c++測試結果是正確的,為何在這裡送出後一直是WA?