#include "scltypes.h"
#include "sclfuncs.h"
using namespace std;
using namespace scl;

int main()
{
  INT_32BIT ix = 15;
  INTEGER n = 15; 

  REAL *a = new REAL[n];
  REAL *ai,*atop;

  INTEGER *idx = new INTEGER[n];
  INTEGER *idxi;

  cout << "\n";
  
  for (ai=a, atop=a+n; ai<atop; ai++) {
    *ai=unsk(&ix);
    cout << *ai << "\n";
  }

  heapsort(a,n,a);

  cout << "\n";

  for (ai=a, atop=a+n; ai<atop; ai++) {
    cout << *ai << "\n";
  }

  cout << "\n";

  ix=15;

  for (ai=a, atop=a+n; ai<atop; ai++) {
    *ai=unsk(&ix);
    cout << *ai << "\n";
  }

  heapsort(a,n,a,idx);

  cout << "\n";

  for (idxi=idx, ai=a, atop=a+n; ai<atop; ai++, idxi++) {
    cout << *ai << ' ' << *idxi <<"\n";
  }

  exit(0);
}









