#include //ソート関数 void InsSort(int a[], int n) { int i, j, temp; for(i = 1; i < n; i++){ temp = a[i]; for(j = i; j > 0 && a[j-1] > temp; j--){ a[j] = a[j -1]; } a[j] = temp; } } int main(void) { int n; int a[1001]; while(1){ scanf("%d", &n); if(n==0) break; // 読み込み for(int i=0; i