代码清单2-21
double MinDifference(double arr[], int n)
{
     if(n < 2)
     {
          return 0;
     }
     double fMinDiff = fabs(arr[0] – arr[1]);
     for(int i = 0; i < n; ++i)
          for(int j = i + 1; j <; ++j)
          {
               double tmp = fabs(arr[i] – arr[j]);
               if(fMinDiff > tmp)
               {
                   fMinDiff = tmp;
               }
          }
     return fMinDiff;
}