O(N^3)
void show_subarrays( int a[], int N) { for (int l=1; l<=N; ++l) { int k = 0; while ( (k+l) <= N) { for (int j=0; j<l; ++j) cout << a[k+j] << " "; cout << "\n"; ++k; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)