Advertisement
Guest User

main

a guest
Apr 1st, 2013
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "mSort.h"
  2. #include <time.h>
  3.  
  4. #include <iostream>
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.    short num = 21;
  10.    short* a = new short[num];
  11.    
  12.    srand(time(0));
  13.    
  14. //fill with random data
  15.    for (short i=0; i<num; ++i)
  16.       a[i] = rand()%200 - 100;
  17.  
  18. //sort  
  19.    mergeSort(a, num);
  20.    
  21. //show
  22.    for (short i=0; i<num; ++i)
  23.       cout<<a[i]<<" ";
  24.    
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement