fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int T[20] = {66, 27, 97, 0, 23, 14, 13, 22, 50, 19, 10, 89, 65, 3, 55, 2, 49, 15, 77, 69};
  5. int i, j, work;
  6.  
  7. for (i = 0; i < 19; i++) {
  8. for (j = i + 1; j < 20; j++) {
  9. if (T[i] > T[j]) {
  10. work = T[i];
  11. T[i] = T[j];
  12. T[j] = work;
  13. }
  14. }
  15. }
  16.  
  17. for (i = 0; i < 20; i++) {
  18. printf("%d%s", T[i], (i == 19) ? "" : ", ");
  19. }
  20. printf("\n");
  21.  
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 5280KB
stdin
Standard input is empty
stdout
0, 2, 3, 10, 13, 14, 15, 19, 22, 23, 27, 49, 50, 55, 65, 66, 69, 77, 89, 97