// ConsoleApplication10.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <iostream>
#include <vector>
#include <list>
#include <deque>
#include <string>
#include <algorithm>
using namespace std;
class LongestDistance {
public:
int getDis(vector<int> A, int n) {
int max = 0;
for (int i = 0;i < n;i++)
{
for (int j = i + 1;j < n;j++)
{
if (max < (A[j] - A[i]))
{
max = A[j] - A[i];
}
}
}
return max;
}
};
int main()
{
LongestDistance ld;
vector<int> A = { 10,5 };
cout << ld.getDis(A,2) << endl;
return 0;
};