Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. int invCnt( int A[], int n )
  2. {
  3.     int i, j;
  4.     int cnt = 0;
  5.  
  6.     for( i = 0; i < n-1; ++i )
  7.         for( j = i+1; j < n; ++j )
  8.             if( A[i] > A[j] )
  9.                 cnt++;
  10.  
  11.     return cnt;
  12. }