1 2 int x[10] = { 0,1,2,3,4,5,6,7,8,9}; 3 4 int main()5main() 6 { 7 int niterations = 0, i; 8 9 for (;;) { 10 int i, mi, max; 11 max = 0; 12 for (i = 0; i < 10 ; i++) { 13 if (x[i] > max) { 14 max = x[i]; 15 mi = i; 16 } 17 } 18 if (max == 0) 19 break; 20 x[mi] = 0; 21 niterations++; 22 if (niterations > 10) 23 abort (); 24 } 25 26 exit (0); 27 } 28