online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> using namespace std; void quicksort(int *tab, int lewy, int prawy) { if (lewy < prawy) { int pivot = tab[(lewy+prawy)/2]; int i = lewy; int j = prawy; while (i <= j) { while (tab[i] < pivot) i++; while (tab[j] > pivot) j--; if (i <= j) { int temp = tab[i]; tab[i] = tab[j]; tab[j] = temp; i++; j--; } } if (j > lewy) quicksort(tab, lewy, j); if (i < prawy) quicksort(tab, i, prawy); } } int main() { int n; cin >> n; // ile elementów (liczb) int *tab = new int[n]; for (int i = 0; i < n; i++) cin >> tab[i]; quicksort(tab, 0, n-1); for (int i = 0; i < n; i++) cout << tab[i] << " "; cout << endl; delete[] tab; return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue