fork(1) download
  1. void sort(int values[], int n)
  2. {
  3. // TODO: implement an O(n^2) sorting algorithm
  4. int sorted = 0;
  5. while (sorted < n+1)
  6. {
  7. for (int i = 0; i < n; i++)
  8. {
  9.  
  10. if (values[i] > values[i+1])
  11. {
  12. int change;
  13. change = values[i];
  14. values[i] = values[i+1];
  15. values[i+1] = change;
  16. sorted = 0;
  17. }
  18. else
  19. {
  20. sorted++;
  21. }
  22. }
  23. }
  24.  
  25. return;
  26. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/usr/lib/gcc/i586-linux-gnu/5/../../../i386-linux-gnu/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty