// QucikSort.cpp : Defines the entry point for the console application. #include "stdafx.h" #include #include #include using namespace std; const int N = 6; int a [N]; void quicksort (int r, int s) { } int _tmain(int argc, _TCHAR* argv[]) { a [0] = 1; a [1] = 10; a [2] = 20; a [3] = 5; a [4] = 7; a [5] = 8; /* initialize random seed: */ /* srand (time (NULL)); for (int i = 0; i < N; i++) a[i] = rand () % 100; */ quicksort (0, N-1); bool ok = true; for (int i = 0; i < N; i++) { if (i+1 < N) if (a[i+1] < a[i]) ok = false; cout << a[i] << " "; } cout << endl; if (ok) cout << "O.K." << endl; else cout << "ERROR" << endl; cout << "Hotovo" << endl; system ("pause"); return 0; }